tags:

views:

196

answers:

2

Hi All,

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

A: 

Check default wordpress .htaccess file. I think you're missing checks for existing files and directories. Something like

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . index.php [L]
</IfModule>
Eimantas
thanks for your answer.Its working but I should be included the .php on the file..I need to eliminate .php also from the url
Haris
Try enabling MultiViews.
Eimantas
A: 

Hi All,

Last I found answer.. thanks for the fist reply to lead me to get answer

<IfModule mod_rewrite.c>
  RewriteEngine on  
  RewriteCond %{REQUEST_FILENAME}\.php -f
  RewriteRule ^([^/]+)/$ $1.php 
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ index.php?n=$1 [L,QSA]
</IfModule>
Haris