How Do You Remove .html , .php

Hello everyone! i need some help how to remove .html and .php so for example ‘Example.co.uk/index
so that it can look super like a great site! i have paid for a custom domain but i reallly want help to remove the .html and other stuff! it would be amazing if you could give me some help with this question and thank you for looking at this!

Add this to your .htaccess file.

Options +MultiViews +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R,L,NC]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.html [NC]
RewriteRule ^ %1 [R,L,NC]

If you don’t have an .htaccess file, create one with that content in your htdocs folder.

6 Likes

Thanks for reusing my code :slight_smile:

3 Likes

Thank you!

2 Likes

what ?

Just a thanks to @alexvf for using the code I put together :slight_smile:

oh can i also say it didnt work! why didnt it?

It should work, as its the code I used when using this hosting. Could share what you have put in your .htaccess file?

yes!

You cannot edit that .htaccess file. If you read the comments at the top of the file, it clearly says create a new file in /htdocs/. So make a new .htaccess file in /htdocs/ and put the code in that.

1 Like

ok but do i need to remove the other ones?

i mean do i need to remove the
warning or keep and what
do i need to keep and not to
keep?

@TigerMANEK426

no you don’t.

give me what i need to do plzz

  1. create a .htaccess file inside htdocs folder
  2. open it
  3. put @TigerMANEK426’s code in it.
  4. save it
3 Likes

Let me add a little detail to what @anon19508339 said.

#1: remove the code provided by @alexvf in the .htaccsss file you showed us above. Than save and close the file.

#2: copy & paste the .htaccess file into the htdocs folder

#3: open the new .htaccess file and delete everything inside of it.

#4: add the code provided by @alexvf (and written by @TigerMANEK426) to the now empty .htaccess file.

#5: save changes and close

#6: clear your cache on your internet browser and try loading you site.

Hope this was helpful!

4 Likes

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.