Htaccess: Rules for files in folders works but !
Posted: Tue Oct 02, 2007 7:16 pm
Hi,
The below url works fine with my rule shown below.
http://www.domain.com/apple/abc.php
RewriteRule ^(.*)/(.*php)$ /view.php?id=$2&folder=$1
BUT
When i try the url http://www.domain.com/def.php i want to work as it work like above.
RewriteRule ^(.*php)$ /view.php?id=$1
Basicly if there is a folder it need to pass the foldername and the php page name to view.php. If there is no folder it should only pass the php page name.
I am trying for the last 2 hrs . Any help would be really appricated.
The below url works fine with my rule shown below.
http://www.domain.com/apple/abc.php
RewriteRule ^(.*)/(.*php)$ /view.php?id=$2&folder=$1
BUT
When i try the url http://www.domain.com/def.php i want to work as it work like above.
RewriteRule ^(.*php)$ /view.php?id=$1
Basicly if there is a folder it need to pass the foldername and the php page name to view.php. If there is no folder it should only pass the php page name.
I am trying for the last 2 hrs . Any help would be really appricated.