Before accessing my php script, user needs to access install.php and configure the script. The install.php will delete itself after completion. After install.php is deleted, user must be able to access index.php
What I have tried:
RewriteEngine On
RewriteBase /myscript/
RewriteRule ^ install.php [E]
I am able to redirect the user to install.php but not to index.php if install.php is not present.
I dont know the RewriteCond to check if install.php is present:
RewriteEngine On
RewriteBase /myscript/
RewriteCond ?? ??
RewriteRule ^ install.php [E]
Any help is appreciated. BTW I am not at all good with .htaccess configurations.
UPDATE :
Thank you for comments and replies. Yes I know that I can redirect through my php script like:
if(file_exists('install.php')){
header('Location: http://'.$domain.'/install.php');
}
But can we do the same with .htaccess ?