Jump to content

PHP Redirect


sonu
 Share

Recommended Posts

Hi,Friends I need small help.I know it is not an big issue for PHP Experts.I need a redirect code like the example below:If user tries to visit www.domain.com/page1.php then it should redirect to home page means index.phpI need to redirect only 1 particular page not all pages.I will insert this code in index.php .Then,if user tries to visit page1.php then it should be redirected to page2.php .But,the code should redirect only if user trying to access page1.Thanks in Advance! Help me Guys.

Link to comment
Share on other sites

you can paste that redirect header in page1.php and point to redirect to page2.php. so that if anyone comes into page1 will be redirected to page2

Link to comment
Share on other sites

you have to put that code in your sub page. and http://yoururl.com will be replaced with your site nameheader('location:http://yoururl.com');

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...