Damian
Damian

Reputation: 555

.htaccess - Remove ALL parameters from URL

I need to remove all GET parameters from address, I tried somethink like this:

<IfModule mod_rewrite.c>

RewriteEngine on
RewriteRule ^index.php/([^/]+)/?([^/]*) /index.php?url=$1&ip=$2&category=$3 [NC]

</IfModule>

<IfModule !mod_rewrite.c>
    ErrorDocument 404 /index.php
</IfModule>

But it's not working...

I need to redirect from:

http://example.com/folder/index.php?url=google.com&ip=10.0.0.0&category=website

to

http://example.com/folder

But keep data from parameters - I need to get it by $_GET['parameter'].

Upvotes: 2

Views: 392

Answers (1)

Quentin
Quentin

Reputation: 943568

You could map http://example.com/folder onto http://example.com/folder/index.php?url=google.com&ip=10.0.0.0&category=website, but then you couldn't pass different query string parameters.

If you want to pass data through the URL then the data has to appear in the URL.

Upvotes: 3

Related Questions