开发者

.htaccess for static seo urls in PHP [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

using seo user friendly in php

I have 3 PHP files: index1.php, index2.php and index3.php

Lets assume I want to have the following SEO paths:

/seo-path1/

/seo-path2/

/seo-path3/

How I could configure the .htaccess file so when a request comes from these sub folder, it redirects to their respective PHP file?

/seo-path1/ ---> goes to index1.php

/seo-path2/ ---> goes to index2.php

/seo-path3/ ---> goes to index3.p开发者_StackOverflow社区hp

Thanks in advance. Greets. Jose.


This should be what you're looking for:

RewriteEngine On
RewriteRule ^seo-path1/$ /index1.php
RewriteRule ^seo-path2/$ /index2.php
RewriteRule ^seo-path3/$ /index3.php
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜