开发者

301 redirect is working for www.example.com but not for

I am getting a strange problem with 301 redirect it the code is working for with www in the link and not working for with out www

RewriteBase /
RewriteRule ^api$ http://example.com/topic/api [R=301,L]

if i type http://www.example.com/api it works but if i do http://example.com/api it doesnt work

A开发者_运维知识库dv thanks prasanth


Check your Virtual Host configuration should be like below

<VirtualHost *:80>
  ...
  ServerName www.example.com
  ServerAlias example.com
  ...
</VirtualHost>

If the page is not found, it is possible that the example.com and www.example.com point to difference directory, otherwise, example.com may not linked to any place yet.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜