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

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

jsf - "PropertyNotWritableException: Illegal Syntax for Set Operation" error when setting value in bean -

arrays - Algorithm to find ideal starting spot in a circle -