user2903727
user2903727

Reputation: 19

redirecting URL with .htaccess not working

Trying to do a simple URL rewrite with .htaccess but it does not seem to be working.

Want to access http://www.example.com/shop/index.php?route=information/information&information_id=11

using the URL http://www.example.com/MyGreatClub2013

This is what I have in my .htaccess which is stored at the www.example.com root level

RewriteEngine On
RewriteRule ^/MyGreatClub2013$ /shop/index.php?route=information/information&information_id=11 [NC,L]

Am I doing something stupidly wrong?

Upvotes: 1

Views: 55

Answers (2)

Eric Alan
Eric Alan

Reputation: 1

Here's a decent guide: http://www.javascriptkit.com/howto/htaccess.shtml

Hope it helps.

Upvotes: -1

anubhava
anubhava

Reputation: 785146

Remove leading slash:

RewriteEngine On
RewriteRule ^MyGreatClub2013/?$ /shop/index.php?route=information/information&information_id=11 [NC,L,QSA]

mod_rewrite rules when used in .htaccess don't match leading forward slash as .htaccess is per directory.

Upvotes: 2

Related Questions