2

I have Joomla installed on root folder and another Joomla installed on a subfolder. I want to redirect www to no-www in subfolder by this code in blog .htaccess:

RewriteCond %{HTTP_HOST} ^(www\.example\.com)?$
RewriteRule ^(.*)$ http://example.com/blog/$2 [R=301,L]

It worked for root redirect but when I want browse internal page it redirect the page to home page.

1
  • You use $2 in place of $1
    – Croises
    Commented Nov 7, 2014 at 8:35

1 Answer 1

1

Try this in your .htaccess inside your subfolder:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.