Mike L.
Mike L.

Reputation: 1966

Quick mod_rewrite help on GoDaddy

This htaccess works fine locally, but on GoDaddy the URL isn't caught by the rewrite engine.

RewriteEngine on

RewriteRule ^products/amsoil/(.*)/$ /products.php?amsoil=$1 [L]
RewriteCond %{HTTP_HOST} ^somedomain.com
RewriteRule (.*) http://www.somedomain.com/$1 [R=301,L]

This worked until a few days ago. Basicallywww.somedomain.com/products/amsoil/this-product/ should forward to www.somedomain.com/products.php?amsoil=this-product ....did work, and still works locally however now I just get a 404 error on www.somedomain.com/products/amsoil/this-product/

Any ideas?

Upvotes: 5

Views: 258

Answers (1)

James R
James R

Reputation: 379

I verified that the following script works on our current hosting plans:

RewriteEngine on rewritecond %{http_host} ^coolexample.com [nc] rewriterule ^(.*)$ http://www.coolexample.com/$1 [r=301,nc]

There is a possibility that you are on an older version of our hosting plans. If that is the case, you may want to consider upgrading. Check out http://x.co/Zecq for a how-to on upgrading. There is also a link to the 4GH FAQ. Please review that before upgrading to avoid unwanted surprises.

Upvotes: 3

Related Questions