How to Change a slug?

username epiz_26997068 and website is https://pro-gamer.ml

on my website, I have some subpages which have slugs such as pro-gamer.ml/index.html or pro-gamer.ml/about.html
I don’t want that so is there any way to change it to like pro-gamer.ml/about-page or pro-gamer.ml/home I tried some research but I didn’t find anything can you help?
It would be nice if someone could help

If you want to remove file extensions, add this to your .htaccess:

Options +MultiViews

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]

im stll confused im new to html and stuff =/

Right so, in your websites folder (htdocs), make a new file called .htaccess.
Put the code above inside that file and save.

thats it?

Yup

it didnt do anything though?

i made a file in htdocs called .htaccess and put in
Options +MultiViews

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]

1 Like

Okay, that’s weird. This is the exact code I use on my website. Let me see if im missing something.

i also have the default .htaccess outside of the folder, would that be the problem?

The htaccess folder outside htdocs cannot be edited. Im not sure why the original code didn’t work. This is the exact code I use on my website which does work.

Options -Indexes +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]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\index [NC]
RewriteRule ^ %1 [R,L,NC]
1 Like

this is in my htdocs

and this is out of it

That is very strange. The code should work but for some reason it doesn’t.

omg i feel dumb i found out why i was in a different website

2 Likes

Oh that makes a lot more sense :joy:

1 Like

ok the about page works but the index page is still the same do i have to edit it?

Do you have that line in the htaccess? ^
If not, add it and it should work.

1 Like

To the first thing in htaccess?

It doesn’t have to be. So long as its in the file its fine.

2 Likes