.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

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -