开发者

Apache ignore htaccess

I have a website that uses mod_rewrite for pretty urls. I have two main urls:

example.com/id
example.com/generate/id

And this htaccess file:

Options +FollowSymLinks
RewriteEn开发者_C百科gine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^generate/([a-z0-9_-]+)$ generate.php?id=$1 [L,NC]
RewriteRule ^([a-z0-9_-]+)$ contact.php?id=$1 [L,NC]

The first url is working correctly, but the second not. Apache shows a 404 error, I think that it's because it's looking for the folder "generate", that doesn't exist, and it can't find the htaccess in the document root.

Thank you


Have you try

RewriteRule ^generate\/([a-z0-9_-]+)$ generate.php?id=$1 [L,NC]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜