Sayed
Sayed

Reputation: 1062

Problem in rewriting links with htaccess

I'm using this htaccess file to rewrite links,

RewriteEngine on

RewriteRule ^([a-zA-Z]+)$ file.php?show=$1

But I'm having problem so, when i go to the page I wanted after rewrite like this: http://somesite.com/mypage It goes to that page successfully, but when you type a slash in the end of the link (http://somesite.com/mypage/) it doesn't open and says 404 error..

Please fix the code so I can enter pages with slashes or without

Upvotes: 0

Views: 55

Answers (1)

scalopus
scalopus

Reputation: 2710

RewriteEngine on
RewriteRule ^([a-zA-Z]+)(\/)?$ file.php?show=$1

Upvotes: 2

Related Questions