: How to redirect requests to another folder using .htaccess? How to redirect requests to another folder using .htaccess? I have my root directory and my website looks into that directory. I want
How to redirect requests to another folder using .htaccess?
I have my root directory and my website looks into that directory. I want it to look in the /subdirectory/ instead. I can't modify the server config.
More posts by @Phylliss660
1 Comments
Sorted by latest first Latest Oldest Best
Try this:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com$
RewriteRule (.*) www.example.com/ [R=301,L]
RewriteRule ^$ subdirectory [L]
If you want an external redirect, set the R flag there as well:
RewriteRule ^$ /subdirectory [L,R=301]
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.