Discussion Locked

Site Redirection

0 helpful
9 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Is there a way in Apache Web Server running on Linux RedHat 7.1 that if URL like http://www.my.webserver.com is typed on the browser, it is automatically redirected to the URL http://www.my.webserver.com/cgi-bin/mail.pl. Or there are some programs for redirection to be used with Apache? Please guide me.

9 replies

by jimbb

Redirection is something you normally do in your HTML page, independant of OS or web server version. I suppose you have on the homepage of your site a file called index.html or so? In that file, you could have a structure like this:

Your site's Title

Please wait while you're being redirected

The Meta-tag does the trick. After 3 seconds (you can change this of course) the viewer is redirected to the site mentioned in the URL. You don't even need to put anything in the body, maybe just give it the same colour as your script will show, so that the redirection is totally transparant for your users.

Jim

by key

You have to configure the httpd.conf, such as change the directory root and the extension type of the first page that will be shown.

by pahosler

Here's one way, of course you will still need to type something like www.my.webserver.com/mail but that should be acceptable. Add this line to /etc/httpd/conf/httpd.conf

Alias /mail "/var/www/cgi-bin/mail.pl"
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all

to keep things in order insert this bit of configuration where the other aliases are defined, you will have to go kind of deep into the httpd.conf file but it is easy to find. You have to do this as root, so remember to su, and restart httpd.
/etc/rc.d/init.d/httpd restart

Let me know if you need more info,
Paul

This discussion is closed to new replies.