Question regarding to setting paths to pages


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?


Add this to your htaccess
Options -Indexes


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


Add these lines just below the rewrite engine on

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


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


You want the user to access ?


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.