nesez docs
Home
develop it
_server
__iis
__apache
__nginx
_web develop
_code
_programming
window it
linux it
android it
ios it
useful site
connect
policy
Home
web
How can I delete .html or .php extension in apache with htaccess?
How can I delete .html or .php extension in apache with htaccess?
nesez docs
July 03, 2020
How can I delete .html or .php extension with .htaccess?
Before delete .html or .php extension with htaccess,
First, you must activate rewrite module.
First, you must activate rewrite module.
Ctrl+v this code in terminal.
sudo a
2
enmod rewrite
If you finished the rewrite activating, You can use htaccess in apache.
Let's delete .html or .php extension!
1.delete .html extension
RewriteEngine On
RewriteRule (.*) https:
//%{HTTP_HOST}%{REQUEST_URI}
RewriteCond %{
DOCUMENT_ROOT
}/$
1
.html -f
RewriteRule ^(.+)/?$ /$
1
.html [
L
]
(ex) magsty.net/index.html -> magsty.net/index
2.delete .php extension
RewriteEngine On
RewriteRule (.*) https:
//%{HTTP_HOST}%{REQUEST_URI}
RewriteCond %{
DOCUMENT_ROOT
}/$
1
.php -f
RewriteRule ^(.+)/?$ /$
1
.php [
L
]
(ex) magsty.net/index.php -> magsty.net/index
3.delete .jsp extension
RewriteEngine On
RewriteRule (.*) https:
//%{HTTP_HOST}%{REQUEST_URI}
RewriteCond %{
DOCUMENT_ROOT
}/$
1
.jsp -f
RewriteRule ^(.+)/?$ /$
1
.jsp [
L
]
(ex) magsty.net/index.jsp -> magsty.net/index
Thanks for watching and write the commet to rewrite request or question
Post a Comment
0 Comments
recent post
As previously announced, nesez will carry out maintenance for 5 days.
July 22, 2021
How can I add Referrer-Policy header in apache with htaccess?
July 03, 2020
how can I use the ssllab's ssltest?
July 01, 2020
conm.eu url shorter support ended
October 24, 2021
How can I add hsts header in apache with htaccess?
July 03, 2020
New function is opened!(url shorter)
October 08, 2021
how to use nesez siteblocker?
October 15, 2020
nesez services new uptime page!
June 06, 2021
How to install nginx+php-fpm+mariadb in ubuntu 20.04?
August 25, 2020
How can I download iis url rewite 2.0?
July 02, 2020
Popular Posts
how can I use cloudflare? (full explaination)
July 01, 2020
How can I add hsts header in apache with htaccess?
July 03, 2020
How can I add Referrer-Policy header in apache with htaccess?
July 03, 2020
Powered by Blogger
2020 copyright nesez net all right reserved
category
apache
iis
nginx
code
android
ios
linux
window
programming
web develop
window
programming
web develop
0 Comments