.htaccess - Removing .html/.php from url with apache conf -



.htaccess - Removing .html/.php from url with apache conf -

i managed remove .extension via htaccess file, wondering if possible through apache2.conf or other file without using .htaccess file.

exp.

example.com/example

instead of

example.com/example.html

you can utilize these 2 rules in apache conf file:

rewritecond %{the_request} \s/+(.+?)\.html[\s?] [nc] rewriterule ^ /%1 [r=302,l,ne] # internally forwards /dir/file /dir/file.html rewritecond %{document_root}/$1\.html -f [nc] rewriterule ^(.+?)/?$ $1.html [l]

apache .htaccess configuration

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -