im having an unknown problem. that , i used url rewriting method to redirect a logged user as domain/members/contactus.php, if he is not logged in i automatically redirect him to domain/contactus.php. The problem is, its working in local and test server.but it doesnt work in live server. i dont know the server settings. client only has. should i change any server settings to fix this problem. pls help me anybody.....
Probably mod_rewrite doesn't work on your server. You need to edit apache's config file to turn it on.
If you are using sessions just check a session exists or actually contains what you set it to, if not redirect... On successful login you set the $_SESSION["logged_in"] to be 1 At the top of each page... if ($_SESSION["logged_in"] != 1) { # User not logged in header("Location: domain/contactus.php"); exit(); } PHP:
hi, thanks for ur reply. mod_rewrite is working for other functionality like , if we type url 'domain/contactus/ it will parse domain/contactUs.php. that type of functionalities working.......then how it should be....