In my .htaccess, I want to take domain.com/path/file.php
and it go to domain.com/file.php?var1=path
I thought the below would work but, apparently not.
RewriteRule ^/(.*?)\/(.*?)/?$ /$2.php?var1=$1
Thanks!
Santiago Trujillo
You may try this rule:
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/$2 -f
RewriteRule ^([\w-]+)/(.+)$ $2?var1=$1 [L]