-2

How to i remove the forward slash from the url of my website.

I have a simple website in php, which runs on linux with apache webserver. It does not uses any complex script etc. But when-ever i type the url http://www.example.com it is converted to http://www.example.com/

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ $1/ [R]
Rahul
  • 441
  • 1
  • 6
  • 16

1 Answers1

1

This should work: RewriteEngine on RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+[^/])$ $1 [R] The $1/ in the last line means the server should handle it as example.com/request-filename/, not like example.com/request-filename, which is achieved by just the $1

jeffkmeng
  • 851
  • 1
  • 8
  • 30