0

Now i use this code for my website.

Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]

This code convert all url of my website:

www.example.com/category/work.php

in

www.example.com/category/work

It's great, but my goal is:

www.example.com/category/work.php

in

www.example.com/category/work/

I need "/" at the end.

Is possibile? This is a typical feature of CMS.

I want it in my site built by me.

1 Answers1

0

You can force trailing slash

RewriteRule ^((.*)[^/])$ $1/ [L,R=301]

Also check this Stackover answer

Community
  • 1
  • 1
tam
  • 352
  • 1
  • 3
  • 13