duanaoyuan7202 2011-08-16 11:10
浏览 72
已采纳

.htaccess mod_alias和mod_rewrite重定向被忽略

I want to redirect all requests to my index.php script in such a way that everything that goes after http://mysite/ would passed to index.php as url-argument. For example, http://mysite/moo.css should become http://mysite/index.php/moo.css and http://moosite/moo/foo/bar/ should become http://index.php/moosite/moo/foo/bar/.

Easy, huh?

But not RedirectMatch (.*) index.php/$1, nor RewriteRule ^(.*)$ index.php/$1 [R,L] (or others regexp like that; RewriteEngine on was not ommitted; mod_rewrite and mod_alias are turned on) took effect.

What's going on?

  • 写回答

1条回答 默认 最新

  • douke9379 2011-08-16 11:13
    关注

    Without knowing anything more, my guess would be that the Allowoverride directive is missing for that directory. (Captain obvious style answer, but still easy to overlook).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部