dql123000
2013-09-23 11:54
浏览 71
已采纳

单个.htaccess用于多个页面重定向与不同的URL

i am changing my website and its old pages were like bellow

http://mydomain.com/keyword_city.html

while i read that its better to use - in page for batter SEO, so i am thinking to use new new page name like bellow

http://mydomain.com/keyword-city.html

first of all i want to know is this better idea to change page URL? and if i change my URL does this effect on page ranking ?

i want to know how to write single .htaccess so that any request coming for old page will redirect to new URL, the only difference in old and new URL will be _ to -

Thanks

图片转代码服务由CSDN问答提供 功能建议

我正在更改我的网站,其旧页面如下:

 < 代码> http://mydomain.com/keyword_city.html
   
 
 

虽然我读到它更好用 - 在面糊中搜索引擎优化,所以我在想 使用新的页面名称,如bellow

  http://mydomain.com/keyword-city.html
   
 
 

首先我想知道改变页面URL这个更好的主意吗? 如果我改变我的URL会对页面排名产生这种影响吗?

我想知道如何写单 .htaccess 以便旧页面的任何请求都会重定向到新的URL,旧URL和新URL的唯一区别是 _ to - \ n

谢谢

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • duankan8739 2013-09-24 10:05
    已采纳

    The following code added to .htacess should redirect all underscores _ to hyphens -

    RewriteRule (.*)_(.*) $1-$2 [N] 
    
    已采纳该答案
    评论
    解决 无用
    打赏 举报
  • douxia1988 2013-09-23 12:05

    I think you are probably looking for:

    Redirect 301 /keyword_city.html /keyword-city.html
    

    to be placed in your .htaccess file.

    As other people have mentioned though, probably not going to help a great deal when it comes to SEO. One thing that could however is using rich snippets/structured data:

    https://support.google.com/webmasters/answer/99170?hl=en

    Can be a lot of effort to do but would really help your presence on Google especially.

    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题