| help! How do I redirect an unautorized user with htaccess ?? [message #883] |
Wed, 13 February 2008 10:09 |
hugaman Messages: 1 Registered: February 2008 |
|
|
|
Hello!
I have 2 folders in my website.
In my site root I have created an index.php file with a login form, once logged in, a cookie is made called 'sascookie' and the user gets to see two buttons that link to the two folders mentioned above. These are a button for a shop and a button for a forum. So these are both in new directories one level up, and each have a index.php page.
All works well except for the fact that a user can bypass the root of the site www.mydomain.com/index.php and go directly to www.mydomain.com/shop or www.mydomain.com/forum WITHOUT loging in.
I am looking for a solution by adding a redirect into a .htaccess file which I plan to place in the forum and shop folder. These files should check if the visitor came (referer) from the site root (index.php) if yes show these content, if not it should redirect the user to the site root (index.php) automatically.
I have tried to find this solution for 2 days now, and tried many things without success ;-( Can anyone tell me how this can be done ?
Note: If not possible with htaccess I also am open to a php solution where I would place a referer check in the index.php files in the forum and shop folders.
Any solution would be hight appreciated!
Kind regards, Marc
PS:
cPanel Version 11.18.0-RELEASE
cPanel Build 20595
Theme x3
Apache version 1.3.37 (Unix)
PHP version 5.2.2
MySQL version 5.0.45-community
Architecture i686
Operating system: Linux
[Updated on: Wed, 13 February 2008 10:16]
|
|
|