: Need to remove www for only one sub directory from a domain I have a domain like www.example.com. I need to remove www. from specified sub folder by using a .htaccess file. Example :
I have a domain like example.com. I need to remove from specified sub folder by using a .htaccess file.
Example :
example.com/blog should redirect to example.com
All other sub folders will not redirect in url like example.com/forum will remain untouched. example.com will remain untouched.
More posts by @Sims2060225
2 Comments
Sorted by latest first Latest Oldest Best
You can put a rewrite rule like this in place in the .htaccess file. In this example "example.com" is the domain name and "subdirectory" is the name of the folder for which you want to remove the "www".
RewriteCond %{HTTP_HOST} ^www.example.com$
RewriteRule ^subdirectory(/.*)?$ example.com/subdirectory [R=301,L]
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.