开发者

Joomla www enforcing in urls with .htaccess, not working as it should

I have a joomla 1.6 website, and I want to enforce a www in the beginning of urls. I've written the following into htaccess:

RewriteCond %{http_host} ^example\.com [nc]
RewriteRule (.*) http://www.example.com/$1 [r=301,nc]

What it should do is redirect from example.com/happy_bunnies.html to www.example.com/happy_bunnies.html. Instead it redirects to www.example.com/index.php


RewriteCond %{http_host} ^example\.com [nc]
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteRule .* http://www.example.com%1 [r=301,nc,l]

No idea why the开发者_JAVA技巧 first didn't work, but this one does


Have you tried...

RewriteCond %{http_host} ^example\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,NC]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜