Corpse2.0
Modder
2
MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1
100 XP
Creating our Pages
First, we are going to create our sample pages. Create the ff files and paste the codes below it.
index.html
login.php
Creating our .htaccess File
Lastly, we create our .htacess file. Create a new file, name it as .htaccess and paste the below codes.
That ends this tutorial. Happy Coding :)
Download
First, we are going to create our sample pages. Create the ff files and paste the codes below it.
index.html
- <!DOCTYPE html>
- <html
>
- <head
>
- <meta
charset
=
"utf-8"
>
- <title
>
How to Remove .html and .php Extension in the URL using .htaccess</
title
>
- </
head
>
- <body
>
- <a
href
=
"login"
>
Login</
a
>
- <p
>
This is the index Page</
p
>
- </
body
>
- </
html
>
login.php
- <?php
- echo
"This is the Login Page"
;
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>How to Remove .html and .php Extension in the URL using .htaccess</title>
- </head>
- <body>
- <a href="index">Home</a>
- </body>
- </html>
Creating our .htaccess File
Lastly, we create our .htacess file. Create a new file, name it as .htaccess and paste the below codes.
- <IfModule mod_rewrite.c>
- RewriteEngine on
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteCond %{REQUEST_FILENAME}.php -f
- RewriteRule ^(.*)$ $1.php
- #RewriteRule ^([a-z]+)\/?$ $1.php [NC]
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteCond %{REQUEST_FILENAME}.html -f
- RewriteRule ^(.*)$ $1.html
- #RewriteRule ^([a-z]+)\/?$ $1.html [NC]
- </
IfModule>
That ends this tutorial. Happy Coding :)
Download
You must upgrade your account or reply in the thread to view the hidden content.