【发布时间】:2014-12-20 04:43:19
【问题描述】:
我正在使用 .htaccess 设置将我在 domain.com 上的 url 从 domain.com/index.php?id=1&... 重写为 seo 友好的 url:www.domain.com/seo-friendly-url/ 23408425,这样:
ErrorDocument 404 /404.php
RewriteEngine on
RewriteCond %{DOCUMENT_ROOT} !-f
RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [L,R=301]
RewriteRule !\.(js|bmp|txt|ico|gif|jpg|png|css|html|htm|swf|flv|xml|bat|ttf|php|mp3|doc|docx|pdf|xls|xlsx|dwg|zip|rar|csv)$ index.php [QSA,L,NC]
Redirect 301 old-seo-url http://www.domain.com/seo-friendly-url/13148934300
从非 cms 网站迁移后,我尝试 301 重定向旧网站的链接:
http://www.domain.com/old-seo-url
到我的结构:
http://www.domain.com/seo-friendly-url/13148934300
,但找不到正确的方法。标准的 301 重定向没有做任何事情。欢迎任何提示。谢谢
【问题讨论】:
标签: apache .htaccess mod-rewrite redirect