Reputation: 44066
Ok so i have this url in my opencart application and it works well
http://site.com/index.php?route=information/contact
but the clients hates the url and wants
http://site.com/contact
i figured i could just do this in my htaccess and all would be good but visiting the url i get nothing
RewriteRule ^(contact)$ index.php?route=information/contact [L,QSA]
any ideas
here is my htacess
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
RewriteRule ^contact$ /index.php?route=information/contact [L,QSA]
Upvotes: 0
Views: 2133
Reputation: 98921
[OpenCart] Enable URL Rewriting for SEO
Upvotes: 2
Reputation: 49887
remove the parenthesis
RewriteRule ^contact$ index.php?route=information/contact [L,QSA]
your .htaccess should look like:
RewriteEngine On
RewriteBase /
RewriteRule ^contact$ /index.php?route=information/contact [L,QSA]
RewriteCond %{REQUEST_URI} !^/contact$
RewriteRule ^([^?]*) index.php?route=$1 [L,QSA]
Upvotes: 4
Reputation: 1579
Is mod_rewrite enabled? Also, you might have to add
RewriteEngine on
before your RewriteRules
Upvotes: 2
Reputation: 6375
Try adding a / before index.php
RewriteRule ^contact$ /index.php?route=information/contact [L,QSA]
Upvotes: 1