How to remove .php, .html, .htm extensions with .htaccess


I am unable to hide .php extension using htaccess.Can you please tell me how to hide .php extension using htaccess

Junior Developer Asked on February 22, 2017 in TECHNOLOGY.
Add Comment
2 Answer(s)
Best answer

RewriteEngine On

RewriteCond %{HTTP_HOST} ^78\.46\.80\.117

RewriteRule (.*)$1 [R=301,L]

RewriteRule    ^([A-Za-z0-9-]+)/([0-9]+)/?$    $1.php?id=$1    [NC,L]    # Handle ID requests

RewriteRule ^([^\.]+)$ $1.php [NC,L]

RewriteCond %{HTTP_HOST} ^www\.aviancetechnologies\.com$

RewriteRule ^/?$ "http\:\/\/aviancetechnologies\.com\/" [R=301,L]

RewriteCond %{HTTP_USER_AGENT} libwww-perl.*

RewriteRule .* ? [F,L]

Team Leader Answered on February 22, 2017.
Add Comment

Thanks a lot.It’s really helpful to me.

Team Leader Answered on February 24, 2017.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.