Carlos Mendoza
Carlos Mendoza

Reputation: 175

apache mod_rewrite get method variable missin

I have a problem with my mods_rewrite rules. I currently have this in the .htaccess file.

<IfModule mod_rewrite.c>
RewriteEngine On

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

I want to access this url through the site.

http://domain.com/activate/?key=3459ae01bd5f5564a49a31ad373bf998

I know its the first re-write rule because I took it out and the activation worked. Can you guys help?

Upvotes: 0

Views: 76

Answers (1)

Prix
Prix

Reputation: 19528

You don't need 2 rules it may break your WordPress doing it like that.

You can try this instead:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^activate/$ /inddex.php [QSA,L]

RewriteRule ^index\.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

On your browser you will see

http://domain.com/activate/?key=3459ae01bd5f5564a49a31ad373bf998

But internally it will be accessing

http://domain.com/index.php?key=3459ae01bd5f5564a49a31ad373bf998

Let me know if that was what you wanted.

Upvotes: 1

Related Questions