开发者

Help with writing a .htaccess file [closed]

Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 11 years ago.

Improve this question

Ive seen alot of .htaccess tuts and none of them seem to make sense. All I want to开发者_如何学Go do is rename my www.example.com/index.php to www.example.com/home

All of these tuts give horrible examples and this is what I have so far. Dont be suprised if it looks bad, I think it does too but idk where to find a decent tut on how to write a correct one

My question was, how would I write a .htaccess file that would successfully rename my index.php to home

This is seriously all I have so far

Options +FollowSymLinks

RewriteEngine On
RewriteBase /


This should be all you need.

RewriteEngine On
RewriteRule ^home$ index.php [L,QSA]
# Rewrite imaginary otherpage to someplace.php...
RewriteRule ^otherpage$ someplace.php [L,QSA]
RewriteRule ^adifferentpage$ someplace_else.php [L,QSA]

Now requests to /home are silently served index.php. Any additional parameters in the querystring are passed in as well.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜