Forum Moderators: phranque

Message Too Old, No Replies

htaccess - redirect to folder

         

quali74

12:03 pm on Feb 16, 2011 (gmt 0)

10+ Year Member



Hello,

I am struggling with a site I built & with its setup.

The site is a aCMS and works with 2 subdomains: 'preview' and 'www'. The site was developped so it works from one folder on the server, the subdomain being used to detect which site to display.

The problem I have is that I need to install this site on an ISP server which does not work the same way as my localfolder. With this ISP, when you create a subdomain, it creates a new subfolder where files can be dropped in. So now I have the www/ and preview/ subfolders and that is big issue. And I do not want to duplicate my files.

However I believe it is possible to redirect to folders using .htaccess. Could anyone point me to the right direction as to how to do this?

Thanks

g1smd

8:19 pm on Feb 16, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You'll likely need an internal rewrite to connect the incoming URL requests to the correct place inside the server filesystem that will deliver the content.

An external redirect would redirect users to a different URL.

quali74

2:27 pm on Feb 17, 2011 (gmt 0)

10+ Year Member



I have had a look at how to do this on the web but I can not find anything that seems suitable. Would anybody have a script that makes the system points from the 'preview' to the 'www' folder

jdMorgan

3:24 am on Feb 18, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Use *nix OS symlinks to make the files appear to be duplicated, or move the site to an IP-based shared hosting account, where you are not stuck with the control-panel-limitation-induced restrictions and can use your previous setup with all domains pointed to the same root folder.

Jim