How: Folder Redirection

Hello,

We have a customer who wants Folder redirection “like they had in cpanel” :cool:

I have had a look at their htaccess file from their cpanel host (apache 1.3 obviously) and it reads:

 RedirectMatch temp ^/$ http://DOMAIN/intro

Is there any way of achieving something similar in Interworx hosted sites?
I have never done very much in htaccess as far as redirect rules etc so please bear with me.

Thanks in anticipation.

Currently, there isn’t a SiteWorx interface for .htaccess manipulation, but there will be in the next version. Unfortunately, until then, you’ll have to create them manually. :frowning:

Socheat

Helo Socheat,

Can you give some pointers on the requirements in the htaccess required to achieve this?

Cheers.

Sure. It’s not as intimidating as you might think.

Redirect <status> <relative_url from> <absolute_url to>

For example, say you have the SiteWorx account foo.com, with the following directories “bar” and “qwerty”:
http://www.foo.com/bar
http://www.foo.com/qwerty

Now let’s say you want www.foo.com/bar to redirect to http://www.messedup.com:
http://www.foo.com/bar -> http://www.messedup.com

The redirect for this would be:

Redirect temp /bar http://www.messedup.com

And say you wanted www.foo.com/qwerty to redirect to www.keyboards.com/qwerty
http://www.foo.com/qwerty -> http://www.keyboards.com/qwerty

The redirect for this would be:

Redirect temp /qwerty http://www.keyboards.com/qwerty

You can find more information about the different Redirect parameters here:
http://httpd.apache.org/docs/2.0/mod/mod_alias.html#redirect

That’ll explain what the <status> parameter does.

Hope that helps,
Socheat

Socheat,

Thanks for the help, tips & pointers - most intuitive, however I am afraid I still have a query:

The client says that in Cpanel (yeah yeah, I know) he has a folder redirection from the ROOT of domain.com to domain.com/flashintro
In the flashintro, directory there is an index page which has a flash movie on it, with a link also to skip into. that link goes back to domain.com and if they click on that, apparently it takes them back to domain.com (and presumably load index.php)

Now I am slightly sruggling to understand how this can actually work. It surely cant know if a visitor has gone to the site, then been referred by another page in the site, can it?

I’m pretty sure it can be done, but not using just simple redirects. Can you get at the original .htaccess file? I’d be interested to see how it was done.

Socheat

Hello, just for the records, I’ve found this free windows tool to be very useful to manage .htaccess files:

http://www.tlhouse.co.uk/HTAccessible.shtml

Juan