2011-09-15 63 views
0

可能重复:
using seo user friendly in php的.htaccess在PHP静态SEO网址

我有3个PHP文件:index1.php,index2.php和index3.php

让我们假设我想要有以下SEO路径:

/seo-path1/ 

/seo-path2/ 

/seo-path3/ 

如何配置.htaccess文件,以便在请求来自这些子文件夹时,它将重定向到各自的PHP文件?

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

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

/seo-path3/ ---> goes to index3.php 

在此先感谢。 迎接。 何塞。

+0

欲了解更多信息:http://stackoverflow.com/questions/1444151/using-seo-user-friendly-in-php –

回答

4

这应该是你在找什么:

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

真是太好了里卡多。 – Jose3d