I am currently working a project with PHP and Apache on a local server using XAMPP. I have an issue on my website, I was wondering if I can delete the last slash of my web URL. For example, I'm running a website in localhost
and it was stored in folder htacces\web\mywebsite
and when I open the website in the browser, the URL bar shows localhost/web/mywebsite/
or 127.0.0.1/web/mywebsite/
.
So if this is normal then it's fine, but why can some site like stackoverflow.com
remove the last slashes, also like stackoverflow.com\question\ask
?
I just want to know about that, is .htaccess
will do? or PHP?
here is the .htacces file that I have written in my website
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1 [QSA]
Could anyone help?