0

I have a url that looks like this

http://example.com/index.php?con=something&met=meh

What i'm trying to do is get rid of con= and met= so the url would look like

http://example.com/index.php/something/meh

That's what i've done so far

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ action=$1 [L,QSA]
RewriteRule ^(.*)$ page=$1 [L,QSA]

but nothing changes, the url it still look the same http://example.com/index.php?con=something&met=meh

What am i doing wrong?

1
  • 1
    RewriteRule ^index.php/(.*)/(.*)$ http://example.com/index.php?con=$1&met=$2 much? Commented Jun 26, 2011 at 18:38

1 Answer 1

3

I did like this:

RewriteEngine on
RewriteRule ^index.php/([^/]+)/?([^/]*) /index.php?con=$1&meh=$2 [NC]

Notice that if you don't pass any meh, it still works.

Sign up to request clarification or add additional context in comments.

1 Comment

it works without the / in /index.php?con=$1&meh=$2 thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.