1
改變我的這個地址htaccess的重定向到WWW非www沒有地址
http://name.com/category/1/news
我使用此代碼htaccess的強制打開的頁面加www。
RewriteEngine On
RewriteBase/
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
當我打開http://www.name.com/category/1/news
然後我重定向到
http://name.com/category.php?id=1&slug=news
這裏是我的全部htaccess文件。
RewriteEngine on
RewriteRule ^news/(.*)$ news.php?id=$1&slug=$2
RewriteEngine On
RewriteBase/
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
謝謝。
'保持在頂部和清晰的瀏覽器緩存301'規則。 – anubhava
@anubhava謝謝。固定。 – leopoldjobs