Forum Moderators: phranque
I am using these commands:
<Files ~ "^.(htaccess¦htpasswd)$">
deny from all
</Files>
Redirect permanent /folder/category/postname.html http://newdomain.com/folder/category/postname.html
Redirect permanent /folder/category/postname2.html http://newdomain.com/folder/category/postname2.html
Redirect permanent /folder/category2/postname.html http://newdomain.com/folder/category2/postname.html
order deny,allow It's working good but if I use same command to redirect:
Redirect permanent /folder http://newdomain.com/folder How to redirect also the main page of /folder without interfere with other redirects ?
If it is first, it will match all requests and redirect for all requests.
Is the target on the same domain, or a different domain?
If it is the same domain, you'll be better off using RewriteRule for all the rules (instead of Redirect), as it will give you more control on pattern matching.
So, a directive such as
Redirect permanent /folder http://newdomain.com/folder If you want to redirect /folder and only /folder, then use RedirectMatch, and be very careful that you understand the regular-expressions pattern-matching that it uses. See the tutorial in our Forum Charter if you need more info.
Jim