I have a .htaccess file in the folder "services" in my website and have to give two urls following
content of htaccess
#------------------------
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^(.*)$ index.php?n=$1 [L,QSA]
</IfModule>
$-------------------------
1. http://www.mysite.com/services/seo-work
2. http://www.mysite.com/services/online-editor
The 1st URL rewritten using htaccess like http://www.mysite.com/services/index.php?s=seo-work
This is working correct. but when i am uploading other file online-editor.php on the same folder "services", it is not working
so how the first url should show the page using index.php?s=seo-work if the page "online-editor.php" is not found in directory otherwise online-editor.php shoud show. I am programatically representing my problem below
if(IsFoundPageInDirectory(online-editor.php))
{
GoToUrl(http://www.mysite.com/services/online-editor.php)
}
else
{
GoToUrl(http://www.mysite.com/services/index.php?s=seo-work)
}
Please help me to get out of this problem Advance thanks for your reply
There is not really if/else
conditions with ifModule
in Apache configuration, but you can use the test in 2 cases : !module
& module
, like this:
<IfModule !module>
# default directives
</IfModule>
<IfModule module>
# decorator directives
</IfModule>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With