I want to rewrite the URL of a page in my website. Its basicly really simple. My original URL looks like this
http://www.mypage.com/website/page.php?slug=my-page
I want it to look like this: http://wwww.mypage.com/website/my-page/
And that works. What doesent work is if you remove the trailing slash. This is my htaccess:
RewriteEngine on RewriteRule ^(.*)/$ page.php?slug=$1 [L] It seems as if i remove the slash the $_GET['slug'] becomes only page.php but with a trailing slash the variable says "my-page".
Is it possible to make it so the link works both without and with trailing slash?
Edit: Does it matter if i have the .htaccess and php file in a childfolder? So my real url is like this: http://www.mypage.com/website/page.php?slug=something
I've now edited the post with how it really is.