doubu5154 2013-05-02 03:52
浏览 61
已采纳

为什么这个mod_rewrite规则不起作用?

When I try to use this rule:

RewriteEngine On
RewriteRule ^articleID/([^/]*)$ /viewArticle.php?articleID=$1 [L]

It sends me to a 404 page.

I am not well-versed in how to use an htaccess, so I most likely did something wrong. I generated it with a tool at generateit.net

I'm trying to access http://majornoob.com/devel/testdesign/articleID/5 which would equal http://majornoob.com/devel/testdesign/viewArticle.php?articleID=5

  • 写回答

2条回答 默认 最新

  • dongting3135 2013-05-02 03:57
    关注

    Try to add a RewriteBase:

    RewriteBase /
    

    Also make sure that your server accept htaccess files. Does the Server configure contains a AllowOverride all statment in your Directory Directive.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?