php - Change rules on local server so URLs don't include file extensions using MAMP? -


this question exact duplicate of:

i'm running local server via mamp pro. urls (expect index.php) require file extension suffix. example: site/page.php

how change rewrite rules site/page

i've attempted adding htaccess file has no effect on file structure. there way via mamp?

this rewrites [every_name].php [every_name] , same .html files

rewriteengine on rewritecond %{request_filename}.php -f rewriterule ^([^\.]+)$ $1.php [nc,l] rewritecond %{request_filename}.html -f rewriterule ^([^\.]+)$ $1.html [nc,l] 

if want one filename extensionless use this:

rewriteengine on rewriterule ^page$ page.php [l] 

somewhat more trivial: don't use rewriterules, , let apache handle all request path extensions (along file type , language auto-negotiation):

options +multiviews 

Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -