htaccess RewriteRule 500错误 - 循环

时间:2014-05-09 15:19:44

标签: php linux .htaccess rewrite

问题很简单 我想改写 http://www.mydomain.com/test123.com 喜欢 http://www.mydomain.com/details.php?domain=test123.com

RewriteRule ^([^/]*)$ /details.php?domain=$1 [L]

感谢。

1 个答案:

答案 0 :(得分:1)

用于重写网址。您可以使用以下.htaccess

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/(index.php)?$ 
RewriteCond %{REQUEST_URI} !^/details.php$ 
RewriteRule ^(.*)$ /details.php?domain=$1 [QSA,L]

它会将http://www.mydomain.com/test123.com重写为http://www.mydomain.com/details.php?domain=test123.com