.htaccess mod_rewrite漂亮的URL

时间:2012-12-13 07:45:10

标签: php .htaccess

我正试图从中获取我的网址:

www.exmple.com/test.php?type=abc&id=12345
to
www.exmple.com/rrr/abc

有可能......? 感谢

1 个答案:

答案 0 :(得分:0)

是。可行的

要解决此问题,只需将以下内容添加到您的htaccess文件中:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yoursite.com
RewriteRule (.*) http://www.yoursite.com/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /index.html HTTP/
RewriteRule ^index.html$ http://www.yoursite.com/ [R=301,L]

更多资源here