GoDaddy上的快速mod_rewrite帮助

时间:2021-10-21 11:03:44

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

这个htaccess在本地工作正常,但在GoDaddy上,重写引擎没有捕获到URL。

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/

这工作直到几天前。基本上www.somedomain.com/products/amsoil/this-product/应转发到www.somedomain.com/products.php?amsoil=this-product ....确实有效,但仍在本地工作,但现在我只得到404 www.somedomain.com/products/amsoil/this-product/上的错误

Any ideas?

有任何想法吗?

1 个解决方案

#1


3  

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]

重写%{http_host}上的RewriteEngine ^ 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.

您可能会使用旧版本的托管计划。如果是这种情况,您可能需要考虑升级。查看http://x.co/Zecq以获取有关升级的方法。还有4GH FAQ的链接。请在升级之前检查一下,以避免意外的意外。

#1


3  

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]

重写%{http_host}上的RewriteEngine ^ 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.

您可能会使用旧版本的托管计划。如果是这种情况,您可能需要考虑升级。查看http://x.co/Zecq以获取有关升级的方法。还有4GH FAQ的链接。请在升级之前检查一下,以避免意外的意外。