Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
February 07, 2012, 12:13:53 AM

Pages: [1]   Go Down
  Print  
Author Topic: site redirect.  (Read 313 times)
hoops4life
Hoops4Life.com
Spaceship Captain
*****
Offline Offline

Posts: 104


WWW
« on: February 01, 2010, 10:19:40 PM »

hi there,

i have a .htaccess file written like below

Quote
RewriteEngine on
RewriteCond  %{HTTP_HOST}  ^(www\.)?hoops4life\.com$ [nc]
RewriteCond  %{REQUEST_URI}  !^/gallery  [NC]
RewriteCond  %{REQUEST_URI}  !^/gallery/index.php  [NC]
RewriteCond  %{REQUEST_URI}  !^/sportsbetanalysis  [NC]
RewriteRule  ^(.*)$  http://www.hoops4life.com/home/$1  [R=301,L]

i want to make my site when type in hoops4life.com it'll redirect to hoops4life.com/home

cos my index file is in the /home folder, and also when i type in hoops4life.com/abc will go to /abc etc etc

is there anything wrong with the code?

because please try to type in hoops4life.com you can see what is the problem appears...

thanks, hope someone can help.
Logged

MrPhil
Berserker Poster
*****
Offline Offline

Posts: 5079



« Reply #1 on: February 02, 2010, 01:33:48 PM »

The only problem is when I give http://hoops4life.com/abc, and it gets into a loop. Add this line to exclude /home:
Code:
RewriteCond  %{REQUEST_URI}  !^/home  [NC]

You can probably get rid of
Code:
RewriteCond  %{REQUEST_URI}  !^/gallery/index.php  [NC]
as it should be handled by the /gallery line before it.
Logged

Pages: [1]   Go Up
  Print  
 
Jump to: