我的htaccess代码是
RewriteEngine on
Options +FollowSymlinks -MultiViews
# URL REWRITE
RewriteRule ^domain-name/?$ domain.php [L]
RewriteRule ^domain-name/registration/?$ domain-registration.php [L]
RewriteRule ^domain-name/price/?$ domain-price.php [L]
RewriteRule ^domain-name/security/?$ domain-security.php [L]
RewriteRule ^domain-name/features/?$ domain-features.php [L]
RewriteRule ^domain-name/faq/?$ domain-faq.php [L]
RewriteRule ^domain-name/provider/?$ domain-why-choose-us.php [L]
RewriteRule ^domain-name/free/?$ domain-free.php [L]
RewriteRule ^domain-name/transfer/?$ domain-transfer.php [L]
# 301
RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]我的问题是,如果我进入http://domain.com/domain-name/free,这是很好的工作。但
http://www.domain.com/domain-name/free转到我原来的php文件(free.php)
如何解决这个问题?
问题解决了我正确的代码是下面的
RewriteEngine on
Options +FollowSymlinks -MultiViews
# 301
RewriteCond %{HTTP_HOST} ^www\.globaliway\.com$ [NC]
RewriteRule ^(.*)$ http://globaliway.com/$1 [R=301,L]
# URL REWRITE
RewriteRule ^domain-name/?$ domain.php [L]
RewriteRule ^domain-name/registration/?$ domain-registration.php [L]
RewriteRule ^domain-name/price/?$ domain-price.php [L]发布于 2011-04-21 20:24:49
我已经修改了您的.htaccess文件以修复一些问题,请从这里复制/粘贴,包括选项行Options +FollowSymlinks -MultiViews
RewriteEngine on
Options +FollowSymlinks -MultiViews
# URL REWRITE
RewriteEngine on
RewriteRule ^domain-name/?$ /domain.php [L,NC]
RewriteRule ^domain-name/registration/?$ /domain-registration.php [L,NC]
RewriteRule ^domain-name/price/?$ /domain-price.php [L,NC]
RewriteRule ^domain-name/security/?$ /domain-security.php [L,NC]
# 301
RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]https://stackoverflow.com/questions/5749289
复制相似问题