.htaccess redirect.

Not sure if this is how most people would do it, but it's how I do it on my site.

Create a blank index.html page and then use something like this in your .htaccess file.

Code:
redirect 301 /index.html http://www.orderoftheflame.co.uk/blog/
 
OP, what do you mean by redirect? If you mean that, when someone requests the subdomain, you want content to load from the directory, then use cPanel; if you already have the subdomain set up, but want to have people who visit the subdomain forwarded to the directory (and have the directory appear in the address bars) then use the solution below.

Not sure if this is how most people would do it, but it's how I do it on my site.

Create a blank index.html page and then use something like this in your .htaccess file.

Code:
redirect 301 /index.html http://www.orderoftheflame.co.uk/blog/

Why bother creating a blank index file? Just do:

Code:
RedirectMatch ^/(.*)$ http://domain.com/folder/$1

…which gives the added benefit of redirecting, say, http://subdomain.domain.co.uk/foo to http://domain.co.uk/subdomain/foo
 
Back
Top Bottom