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

Answered

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

bubaidas Junior Developer Asked on February 22, 2017 in TECHNOLOGY.
Add Comment
2 Answers
Best answer

RewriteEngine On

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

RewriteRule (.*) http://aviancetechnologies.com/$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

Your Answer

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