Forum Moderators: phranque

Message Too Old, No Replies

.htaccess Help

         

justadad

1:55 pm on Nov 16, 2007 (gmt 0)

10+ Year Member



Ok we are up on our new CMS system (HS) and things are going ok. For the past year people have accessed our site by going to www.example.com/forums which access' our IPB, now the main page for the HS site is at www.example.com. what I want to happen is if you got to www.example.com/forums you get redirected to the main CMS page unless you click the forums link on the CMS site.

so I came up with an htaccess file that looks like this

AuthUserFile /dev/null
AuthGroupFile /dev/null

RewriteEngine On
RewriteCond %{HTTP_REFERER}!^http://example.com/forums/
RewriteCond %{HTTP_REFERER}!^http://www.example.com/forums/
RewriteCond %{HTTP_REFERER}!^http://example.com/
RewriteCond %{HTTP_REFERER}!^http://www.example.com/
RewriteCond %{HTTP_REFERER}!^http://www.example.com/
RewriteCond %{HTTP_REFERER}!^http://www.example.com/
RewriteRule /* http://www.example.com/index.php [R,L]

it kind of works. if I go to /forums it will push me back to the main CMS page. if I click the link on CMS page it loads up the main ipb page.

The issue is that if I click a link on the forum it pushes me back to the main HS page and my images do not show up on the main ipb page.

[edited by: engine at 2:08 pm (utc) on Nov. 16, 2007]
[edit reason] examplified [/edit]

phranque

2:38 pm on Nov 16, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld [webmasterworld.com], justadad!

the first thing you want to do is canonicalize your domain, so it always externally redirects to either example.com or www.example.com.
you can find several references in the charter [webmasterworld.com] and library [webmasterworld.com] pages for the WebmasterWorld apache forum.
you can ask questions after school...