Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

1st of all the disclaimer: this is my very first "meeting" with .htaccess, and I'm not a sysadm, never was, but the guy in the neighborhood, who used to set up the machine.

So now I have to set up one friends cgi (pyblosxom) based site (on freehostia).

I have a directory tree like this:

mysite (path on freehostia is: /home/www/sitename)
|-cgi-bin
||-cgiscript.cgi
|-pybloxsom-installation
|-data

My problem: I want to redirect all incoming request to http://mysubdomain.freehostia.com/ (the root, and if possible http://mysubdomain.freehostia.com/data/ and http://mysubdomain.freehostia.com/pybloxsom-installation/ ) to http://mysubdomain.freehostia.com/cgi-bin/cgiscript.cgi .

Could someone explain how to do that? All my tries lead to infinite redirections.

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

Try to put in a .htaccess file in the mysite directory :

RedirectMatch ^/$ http://mysubdomain.freehostia.com/cgi-bin/cgiscript.cgi
RedirectMatch ^/data/ http://mysubdomain.freehostia.com/cgi-bin/cgiscript.cgi
RedirectMatch ^/pybloxsom-installation/ http://mysubdomain.freehostia.com/cgi-bin/cgiscript.cgi

it might not work if your hosting provider doesn't allow it.

share|improve this answer
    
Problem solved, thank You very much! –  Zsolt Botykai Sep 4 '09 at 11:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.