HMBeaty
09-02-2009, 07:24 PM
Not sure what I'm doing wrong here, I did a test run a few months ago and everything went pretty good, but now, I'm just stuck at the .htaccess file since I can't remember where I got the code to use to redirect how I need it to.
Basically, I just my forums from www.mysite.com/forum/ to www.mysite.com/forums.php with my homepage at index.php.
Now, I just need to redirect all the old url's from when everything was at mysite.com/forum to the new url mysite.com/forums.php
This is how I currently have my .htaccess file but it doesn't work (at least the second bit doesn't)
RewriteEngine On
rewritecond %{http_host} ^usmilitarylife.com
rewriteRule ^(.*) http://www.usmilitarylife.com/$1 [R=301,L]
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/forum/.*$
RewriteRule ^/forum/(.+)$ http://www.usmilitarylife.com/$1 [L,R]
The first bit, don't worry about that as that just redirects all url's to www, its the 2nd bit that I'm having trouble with.
Thanks in advance :)
--------------- Added 1251949323 at 1251949323 ---------------
Ok, got it fixed by adding a .htaccess file to the forum directory with these contents...
redirect 301 /forum http://www.usmilitarylife.com
It's not how I did it last time, but it works :)
Basically, I just my forums from www.mysite.com/forum/ to www.mysite.com/forums.php with my homepage at index.php.
Now, I just need to redirect all the old url's from when everything was at mysite.com/forum to the new url mysite.com/forums.php
This is how I currently have my .htaccess file but it doesn't work (at least the second bit doesn't)
RewriteEngine On
rewritecond %{http_host} ^usmilitarylife.com
rewriteRule ^(.*) http://www.usmilitarylife.com/$1 [R=301,L]
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/forum/.*$
RewriteRule ^/forum/(.+)$ http://www.usmilitarylife.com/$1 [L,R]
The first bit, don't worry about that as that just redirects all url's to www, its the 2nd bit that I'm having trouble with.
Thanks in advance :)
--------------- Added 1251949323 at 1251949323 ---------------
Ok, got it fixed by adding a .htaccess file to the forum directory with these contents...
redirect 301 /forum http://www.usmilitarylife.com
It's not how I did it last time, but it works :)