开发者

.htaccess question: http://www.example.com/contact should show http://www.example.com/contact.php (without redirecting)

As said in the Title,I want that http://www.example.com/contact should show http://www.example.com/contact.php. And important: without redirecting.

Unfortunately my .htaccess Code does not work:

Options +FollowSymlinks
RewriteEngine On
RewriteRule ^contact$ contact.php [L]

What could be the rea开发者_开发百科son for this? Please help me out how to fix it :(!

EDIT: SOLVED. Google helped me out. Adding Options -Multiviews was the Solution. Thanks everyone!


I do believe you have to put the / at the beginning of contact because it's part of the path.

Try this:

Options +FollowSymlinks
RewriteEngine On
RewriteRule ^/contact$ contact.php [L]


The only way to make the URL at the top show .php when going to the URL without PHP would be to redirect the browser to it. The easiest way to do that in most apache instances would be:

Redirect permanent /contact http://example.com/contact.php
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜