Hi,
I have a PHP web site and want to deactivate a php driven page. In other words- I want to remove the page, but only on a tempoary basis.
How can I do this? Can this be done in the .htaccess file? Thx for your help.
Hi,
I have a PHP web site and want to deactivate a php driven page. In other words- I want to remove the page, but only on a tempoary basis.
How can I do this? Can this be done in the .htaccess file? Thx for your help.
Are you trying to just stop the page from processing on load? Just place exit() at the top:
exit();
If you’d like to redirect a user to another page first, use header():
header('Location http://www.example.com');
exit();
That will “deactivate” this page from processing as long as the exit is placed before any code. You can turn it back on by removing this bit of code.
Hi - the thing is one file on the server is being used to generate many pages. So if I go in and edit that one file, other pages will be affected also. The pages are dynamically generated from a database. I want to be able to just deactivate the one page, but it does not have its own standalone php file dedicated strictly to it. Thx.
Right. You could try adding a redirect to the .htaccess file AFTER the URL rewrite rules. Though I’m not an expert there so it may not work as intended. Your redirect would look something like this:
Redirect 301 /page-to-deactivate http://www.example.com
Without seeing the code generating the page, there’s really not gonna be an answer to this question (a redirect would require a unique URL)