redirect to a sub domain, dns or .htaccess

rszkutak

Verified User
Joined
Dec 22, 2003
Messages
180
Location
Scottsdale, AZ & Clam Gulch, AK
I'm sure this one is easy, but it's not really something that I have done.

I have a client who's developing a new website and we're going to assist on the backend with the "cutover". DNS has already been moved to the server and mirrored so we can just change the DNS records to the server and be done. My TTL on the DNS is set to 900 so the refresh time on DNS is short, the DNS was cut over about 4 days ago.

that having been said, what is the best method to do a redirect from the root to a sub folder. DNS or .htaccess files? Also how to do it.

As reference the domain is this:

kgcoatings.com


the new site and shopping cart is at
shop.kgcoatings.com/kg


(site is a static IP, and it's also going to get a SSL once we get it cutover. It will be "down" for about 48 hours while some final tasks are wrapped up and such)

On another site I did a .htaccess like this and it works without any issues

# This allows you to redirect index.html to a specific subfolder
Redirect /index.html http://www.paintwerkz.com/site/


When i tried this in testing i think it acted goofy on me for some reason.

# This allows you to redirect index.html to a specific subfolder
Redirect /index.html http://shop.kgcoatings.com/kg

What it did, i believe from the .htaccess was this. it could have also been something within wordpress that made it do that.
http://shop.kgcoatings.com/kg/kg/kg/kg/kg/kg/kg/kg/kg/kg/kg/kg/kg/kg/kg/kg/kg/kg/kg/kg/kg

thank you in advance.
 
Hello,

DNS can not be used to redirect requests to a sub-folder.

So you can use mod_rewrite rules for this in .htaccess. Search internet for examples.
 
Back
Top