Jump to content

Help with regular expression and mod_rewrite


peeeer

Recommended Posts

Hi,

I have links like these that I want to change:

mypage.com?page=missions&id=5

mypage.com?page=hello

 

I tried to change them into easier links with this:

Options +FollowSymLinks

RewriteEngine On

RewriteRule ^([^/]*)/([^/]*)$ /index.php?page=$1&id=$2 [L]

 

It works but if I want to access pages like (mypage.com?page=hello) I have to write:

mypage.com/hello/

and if I write without the slash in the end like this

mypage.com/hello

it doesn't work.

 

How do I fix it? :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.