Mobile app version of vmapp.org
Login or Join
Connie744

: Redirecting www to non www in subfolder 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

@Connie744

Posted in: #301Redirect #Htaccess #NoWww #Subdirectory

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 ^(.*)$ example.com/blog/ [R=301,L]


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

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Connie744

1 Comments

Sorted by latest first Latest Oldest Best

 

@Speyer207

Try this in your .htaccess inside your subfolder:

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

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme