0

I need to make a simple redirection on Apache. I have a site, let's call it www.example.com with a sub-folder "/dev". What I want is to write a rule in Apache to redirect "www.example.com/dev/" to "www.example.com/dev" (without slash).

I tried the following but it doesn't work :

RewriteEngine On
RewriteRule ^/dev/ /dev [R,L]

I guess this is due to the fact that the redirection is performed on www.example.com/dev/* whereas I want it only on "/dev"

Thanks for your help

MrFlo
  • 309
  • 1
  • 5
  • 14
  • You may want to refer to this link: http://stackoverflow.com/questions/21417263/htaccess-add-remove-trailing-slash-from-url – Joseph D. May 17 '17 at 07:42
  • Thanks. I tried to implement it but no success. I used the following : RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} (.+)/$ RewriteRule ^ %1 [R,L] – MrFlo May 17 '17 at 08:06

0 Answers0