![](/img/trans.png)
[英]Need to redirect (301) just the exact URL : www.abc.com/wholesale but it's rewriting everything with “wholesale”
[英]Do I need a 301 Redirect after clean URL's
我刚刚完成了清理网址的过程
原始脏网址:-http: http://www.michelledaniels.co.uk/photos/index.php?/page/contact-michelle
page/contact- http://www.michelledaniels.co.uk/photos/index.php?/page/contact-michelle
新的干净网址:-http: http://www.michelledaniels.co.uk/photos/page/contact-michelle
我现在应该设置301重定向以避免重复的内容问题吗?
非常感谢您的帮助?
是的,您确实需要301从旧URL重定向到新URL,以避免重复的内容。
通过httpd.conf
启用mod_rewrite和.htaccess,然后将此代码放在DOCUMENT_ROOT
目录下的.htaccess
:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+(photos)/index\.php\?([^\s]+) [NC]
RewriteRule ^ /%1/%2? [R=301,L]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(photos)/(.+?)/?$ /$1/index.php?$2 [NC,QSA,L]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.