Question regarding to setting paths to pages


#1

Hello. I’m looking for a way to set paths to pages in my site.
So far, I’ve been creating a folder and putting there a file named “index.html” or “index.php” - then, when the user enters the directory, he would see a “/” at the end of the URL.
What I want to do is the same, except without letting the user see the ending “/”.

How can I achieve this?
Thanks!


#2

Add this to your htaccess
Options -Indexes


#3

Thanks for replying, but unfortunately it didn’t work.


#4

Add these lines just below the rewrite engine on

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [R=301,L]


#5

For some reason, it doesn’t work. Take this URL of my website as an example.


#6

You want the user to access your.website/google/ ?


#7

Right now, when I create a page in my site, I make a folder and then put an index.php file in it, and then link to the folder.
This means that the URL has a “/” at the end because it’s a folder.