我有一个网站,我有一些子目录列出服务。是这样的。
example.com/services/website-development.htmlexample.com/services/web-development/e-commerce.htmlexample.com/services/web-development/wordpress.html我使用web-development是因为我不能使用名为website-development的目录,因为example.com/services/website-development.html是一个页面。
现在的问题是谷歌已经爬上了example.com/services/web-development的目录列表页面。它试图对页面进行索引,我在搜索控制台中得到了移动可用性错误:
文本太小,无法读取,可单击元素太接近,视图端口未设置
该目录中没有index.html。
是否将该URL重定向到website-development.html URL是处理这种情况的最佳方法?
发布于 2020-09-16 19:30:51
如果在example.com/services/web开发中没有网站,您可以使用重定向将访问该URL的任何内容推送到正确的位置,也可以使用sitemap.xml来定义Google索引。
在web服务器的根级使用htaccess,如何将一个页面重定向到另一个页面:
RewriteRule ^url-string-to-redirect$ http://www.yourdomain.com/your-new-url-string [R=301,L]或
Redirect 301 /path/to-old-url http://www.cyourdomain.com/path/to-new-url若要将整个目录的内容重定向到另一个目录,请使用以下命令:
RewriteRule ^subdirectory/(.*)$ /anotherdirectory/$1 [R=301,NC,L]要将整个目录的内容重定向到webserving根目录,请执行以下操作:
RewriteRule ^subdirectory/(.*)$ /$1 [R=301,NC,L]将子目录的内容重定向到另一个域,但位于同一子目录中
Redirect 301 /subdirectory http://www.anotherdomain.com/subdirectory确保.htaccess文件的打开包含以下两行代码,使Apache模块能够重写URLS,然后将重定向放在它们下面。
Options +FollowSymLinks
RewriteEngine Onhttps://webmasters.stackexchange.com/questions/131314
复制相似问题