Nikhil Bhandari
Nikhil Bhandari

Reputation: 1584

Rewrite URLs Using .htaccess

Referring to the article here I created my .htaccess file with the following lines

RewriteEngine on

RewriteRule ^/product/([0-9]+)/(.*)$ /index.php?route=product&product=$1 [L]

but this doesn't work and I get a 404 error.

I want URLs like

http://localhost/product/12/some-random-text.html

to be redirected to

http://localhost/index.php?route=product&product=12

I am using GoDaddy's Linux hosting

Upvotes: 1

Views: 194

Answers (1)

Adam M.
Adam M.

Reputation: 773

Try changing your RewriteRule to:

RewriteRule ^product/([0-9]+)/(.*)$ /index.php?route=product&product=$1 [QSA,L]

Upvotes: 1

Related Questions