2011-04-21 226 views
0

我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] 
+0

請儘量明確你想要做什麼,以及在哪種計算機語言。這是不可理解的,對不起。 – 2011-04-21 20:22:24

回答

0

我已經修改.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] 
+0

Thanx。我的代碼如下的 選項+的FollowSymLinks -MultiViews #處理HTTP(不工作) RewriteEngine敘述重定向 的RewriteCond%{HTTP_HOST} ^(WWW \。)?域\ .COM $ [NC] 的RewriteCond%{SERVER_PORT} = 80 重寫規則^(。*)$ http://domain.com/$1 [R = 301,L] #URL REWRITE 重寫規則^域名/?$ domain.php [L] 重寫規則^域名/註冊/?$ domain-registration.php [L] RewriteRule^domain-name/price /?$ domain-price.php [L] RewriteRule^domain-name/security /?$ domain-security。 php [L] – Joshua 2011-04-21 20:36:40

+0

困難t o從評論中瞭解,你會在你的問題中附上這個問題嗎? – anubhava 2011-04-21 21:06:27

+0

@anubhava 對不起!現在我正在更新我的Qustion。 – Joshua 2011-04-22 02:45:01