Log in

View Full Version : mod_rewrite


Tanner
22-08-2009, 18:29
Hi all,

I'm trying to get our teams website to redirect anything from the main domain to a subfolder including all directories. For example:

prhsrobotics.com/ => prhsrobotics.com/team
prhsrobotics.com/folderA => prhsrobotics.com/team/folderA

I know it has to do with Apache's mod_rewrite (though you'd think there'd be something in cPanel to do this, idk), but I am terrible at Apache and regular expression stuff.

I've had results from Google, but none seem to work.

Help?

Thanks
-Tanner

lynca
22-08-2009, 23:58
Here are a few references on managing redirects in cPanel.

https://my.rochen.com/index.php?fuse=knowledgebase&view=KB_viewArticle&articleId=84

http://www.youtube.com/watch?v=heoD2HdOKqc

Flyin' Axe
23-08-2009, 12:25
Alternatively, you can try using

<?php Header("Location:http://www.google.ca"); ?>

This has to be a part of a php file. It probably wouldn't work for .html but I haven't tried it.

For HTML, you can use

<meta http-equiv="refresh" content="0; URL=http://www.google.ca">


Good Luck!