I've got a few pages that have moved from domain.com/directory/ to directory.domain.com/ How can I redirect anything with "/directory" in the url to directory.domain.com? I'm not worried about individual pages, but I want anyone using the old directory url to end up on the subdomain. I'm also not worried about SEO implications (for once). e.g domain.com/directory/ >>> directory.domain.com domain.com/directory/blabla/ >>> directory.domain.com domain.com/directory/blabla/html >>> directory.domain.com
This should suit your needs: RewriteEngine On RewriteRule ^(.*?)/.*$ http://$1\.pastebin\.com [R] Code (markup): It redirects the directory to pastebin for now, just so you can see it works Rep greatly appreciated. Jay