How can I redirect any possible url under domain.com/olddir/ including the dir itself all to go just to domain.com/newdir/ using a 301 redirect in .htaccess? I mean something like: redirect 301 /olddir/ http://www.domain.com/newdir/ Code (markup): But that it would get every url in that old dir to go to the exact new link... Thanks!
Hi! EDIT RedirectMatch seemed to be my friend RedirectMatch 301 /hp/username(/[0-9a-zA-Z]+) username.domain.tld Code (markup): Does this keep page rank? /EDIT I am sorry for bumbing this thread, but the reply from Cachi isn't doing it for me. If I call up the old folder and file through a browser, like domain.com/old/mayhem.php the redirect takes mayhem.php with it forming this url: domain.com/new/mayhem.php I want mayhem.php or any other file request to be left out, so that it only redirects to the root of the new folder. Now, this is just an example, in real life I can't use mod_rewrite, cause I need to redirect to a subdomain that resides outside of my public_html folder, and as I understand it, mod_rewrite can't rewrite outside of the root folder. Here's my code, had to remove http:// before the last username reference: Redirect 301 /hp/username username.domain.tld Code (markup):