PDA

View Full Version : .htaccess help for Redirecting domain to subfolder



Foddy
09-30-2009, 11:53 AM
I need help figuring out exactly how to redirect a domain which to a subfolder domain both in BH. And I want to maintain the main domain to appear as teh url address and not the subfolder domain to show up.

I was told by bluehost that I had to do this in the .htacess file, but I have no idea which .htacess file to change or what to put inside of it and I am not a programmer so I need to have the information directed in a very userfriendly and easy way.

If anyone can help that would be appreciated.

redsox9
09-30-2009, 12:10 PM
Check out this BlueHost tutorial, which explains redirection through the .htaccess file: http://helpdesk.bluehost.com/index.php/kb/article/115

Also, do a search of the forums. This has been answered more than a few times.

Foddy
09-30-2009, 12:27 PM
I have looked at them and the link you posted but it still reads greek to me. I can see there is a .htaccess file in each of my current subfolders, with the exception of the domain folder that I want to redirect, so I wouldn't even know where to begin if I was to alter one of them. Which one would I change to start? All the information provided so far is advanced information, I need very simple and basic steps to understand where to begin. This includes how to chnge or edit a .htaccess file inside of BH cpanel because I wouldn't even know how to do it externally.

thanks

JamesYap
10-03-2009, 02:54 AM
I need help figuring out exactly how to redirect a domain which to a subfolder domain both in BH. And I want to maintain the main domain to appear as teh url address and not the subfolder domain to show up.

This is not easy even with PRO! What I understand is you want www.yoursite.com to shows the contents of subdomain.yoursite.com while the address bar is still showing www.yoursite.com. Is that right? There isn't a simple solution to this because technically both are totally different sites even they are in the same hosting account. It is like trying to load the contents of www.mysite.com and your address bar still showing www.yoursite.com.

The easiest solution is to upload everything in your subdomain to the main domain instead of trying to do "redirection".

felgall
10-03-2009, 12:28 PM
If thety were separate domains then all you'd need to do is park one on top of the other and set up a 301 redirect. If it is an add-on domain and a sub domain you could do the same by pointing them both at the same folder and setting up a redirect.

For the main domain and a subdomain the simplest way would probably be to set up the appropriate .htaccess in public_html to redirect the main domain into a folder then set up the subdomain on the same folder and set up the .htaccess in the folder to do the 301.