killervastu Posted January 23, 2012 Share Posted January 23, 2012 Hello everyone, I am creating a site that has two modes 1.Default 2.under construction I use database to see weather the site is under construction or not. The template of under construction is different and is stored in a another directory eg: site url: www.my.com under construction page: www.my.com/uc now i want that when the database is selected for under construction the URL should show www.my.com not www.my.com/uc Please help me with this. I tried to redirect with header(location: '.......'); but in the URL it shows www.my.com/uc Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/255602-redirect-page-using-php/ Share on other sites More sharing options...
ManiacDan Posted January 23, 2012 Share Posted January 23, 2012 Don't use header redirects then. Have the under contructions page be a template or a PHP include. At the very top of your index, check to see if the site is in maintenance. If it is, include the maintenance template and die. Quote Link to comment https://forums.phpfreaks.com/topic/255602-redirect-page-using-php/#findComment-1310360 Share on other sites More sharing options...
killervastu Posted January 23, 2012 Author Share Posted January 23, 2012 so you are saying that i should also make a include page of the Default page and check it for the status?? Quote Link to comment https://forums.phpfreaks.com/topic/255602-redirect-page-using-php/#findComment-1310368 Share on other sites More sharing options...
killervastu Posted January 23, 2012 Author Share Posted January 23, 2012 [sOLVED] Thanks man it made my work. But what if i want to do that type of redirection. Quote Link to comment https://forums.phpfreaks.com/topic/255602-redirect-page-using-php/#findComment-1310369 Share on other sites More sharing options...
ManiacDan Posted January 23, 2012 Share Posted January 23, 2012 You can't redirect a customer to one URL but show them a page from a different URL. The URL is the address of the page you're viewing. You can use mod-rewrite to change one URL to a different file. Quote Link to comment https://forums.phpfreaks.com/topic/255602-redirect-page-using-php/#findComment-1310376 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.