.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

Using Android Volley to post an array to PHP -

python - How to add an model instance to a django queryset? -

angularjs - No 'Access-Control-Allow-Origin' error from local domain to public API -