2
我有兩種類型的網址:.htaccess;重定向過多,如果在.htaccess兩個不同的重定向
http://www.example.com/?content=contact_form.php
和
http://www.example.com/?content=product.php&id=20
我改變了我的整個系統的網址是這樣的:
http://www.example.com/file/contact_form
and
http://www.example.com/product/I-m-the-title/20
當然,我做了301重定向.htaccess
告訴谷歌和co。新的網址。
我做了這樣的:
# Rewrite URLs
RewriteEngine On
RewriteRule ^(ignore)($|/) - [L]
RewriteRule ^file/([^/]*)$ /?content=$1.php [L]
RewriteRule ^([^/]*)/([^/]*)/([^/]*)$ /?content=$1.php&title=$2&id=$3 [L]
# Redirect old URL to new URL
RewriteCond %{QUERY_STRING} ^content=contact\_form\.php$
RewriteCond %{REQUEST_URI} ^\/$
RewriteRule .* http://www.example.com/file/contact_form? [R=301,L]
RewriteCond %{QUERY_STRING} ^content=product\.php&class=I-m-the-title$
RewriteCond %{REQUEST_URI} ^\/$
RewriteRule .* http://www.example.com/I-m-the-title/Test/20? [R=301,L]
我的問題:
它完美工作:http://www.example.com/?content=product.php&id=20
但http://www.example.com/?content=contact_form.php
我得到它沒能打開郵件因爲重定向過多。
有人知道我在做什麼錯嗎?我希望有人能夠儘快幫助我,因爲在Google誤解它之前我必須解決它。
你太棒了。謝謝,非常感謝你! – David