The Codesee The Codesee - 5 months ago 35
PHP Question

Remove html extension from url using mod rewrite

I have used mod rewrite to change this url:


Using this:

RewriteRule ^([^/]*)\.html$ /first.php?second=$1 [L]

How can I remove the
file extension?

Answer Source
RewriteRule ^([^\.]+)$ $1.html [NC,L]
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download