-1

我正在寻找一个 htaccess 代码,它可以帮助我将我的 URL 重写为友好的 URL

我在互联网上搜索了很多..但没有一个很好

example.com/hospitals.php?cname=AOL Hospital    
should rewrite as example.com/hospitals/AOL Hospital   


example.com/collages.php?cname=Big O 
should rewrite as example.com/collages/Big O Collage
4

1 回答 1

1

你这样搜索?

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^(.*)/(.*)$ $1.php?cmname=$2 [L]
</IfModule>
于 2013-08-06T11:57:06.163 回答