.htaccess - 2 Rewrite Rules for 2 Conditions? -
rewritecond %{request_filename} !-f rewriterule ^([^\.]+)$ $1.php [nc,l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . core.php
now have above but, know how/if can mix these one. i'm new .htaccess if give me link or somewhere learn great. ;)
i couldn't find awnser worked on google searches or explain how works can configure work me. :l
you can use :
#rewrite /file /file.php rewritecond %{request_filename}.php -f rewriterule ^ %{request_uri}.php [nc,l] # rewrite other request /core.php rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^ /core.php [nc,l]
explaination :
rewritecond %{request_filename}.php -f
the line above checks ensure uri.php file, if existent php file,
rewriterule ^ %{request_uri}.php [nc,l]
the rule rewrites request orignal location request.php (file => file.php)
Comments
Post a Comment