Szymon Zachariasz
Szymon Zachariasz

Reputation: 343

How to set up .htaccess to rewrite to url without a slash on the end

I just need to get out of slash in the end of my url.

My .htaccess right now look like this:

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^([a-zA-Z0-9]*)/?$ index.php [QSA]

i need another ruler that erase slash in the end of url if someone will paste it there

Upvotes: 1

Views: 3216

Answers (1)

DuhVir
DuhVir

Reputation: 481

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

Flag [L] stop .htaccess reading, and [R=301] generate HTTP-answer code HTTP/1.1 301 Moved Permanently.

Upvotes: 1

Related Questions