htaccess 正在工作,但不会替换 url
我正在尝试修改 URL 中的子域名以使其看起来更好。我当前的 URL 看起来像这样:
www.mystore.com/productInfo.php?cPath=11_11&productID=222
因此,我想通过使用以下代码在 main 中的 .htaccess 中重写来使其更好:
RewriteEngine On
RewriteRule ^productInfo/([0-9_-]+)/([0-9_-]+) productInfo.php?cPath=$1&productID=$2 [NC,L]
当我通过键入 www.mystore.com/productInfo/11_11/ 在 URL 上运行并测试它时222
在 URL 中效果很好。但是,当此页面被其他页面重定向或使用自重定向 a href=
链接“刷新”时(其中该链接是由以前的程序员用 php 编写的),上述旧链接在 URL 中仍然可见,而不是在新 URL 中可见。
我仍然是一个初学者,虽然我怀疑我可能需要为此更改 cPanel/Apache 中的某些内容(我认为),但目前,我仍然无法访问 cPanel 控件。是否有任何我可能错过在 .htaccess 文件中写入的内容,或者我确实需要 cPanel 控件或任何其他原因?
任何帮助表示赞赏。抱歉,我找不到与此相关的类似问题。
I'm trying to modify the subdomain name in the URL to make it look nicer. My current URL look something like:
www.mystore.com/productInfo.php?cPath=11_11&productID=222
So, I want to make it nicer by Rewrite in .htaccess in main with this code:
RewriteEngine On
RewriteRule ^productInfo/([0-9_-]+)/([0-9_-]+) productInfo.php?cPath=$1&productID=$2 [NC,L]
When I run and test it on the URL by typing www.mystore.com/productInfo/11_11/222
in the URL it works well. However, when this page is redirected by a different page or is 'refreshed' with a self redirecting a href=
link(in which the link is written in php by the previous programmer), the above old link is still visible in the URL instead of the new one.
I am still a beginner while I suspect that I might need to change something in the cPanel/Apache(I think) for this but currently, I am still do not have access to the cPanel control. Is there anything that I might have missed to write in the .htaccess file or I really do need the cPanel control or any other reasons?
Any help is appreciated. Sorry that I could not find similar questions on this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用以下内容:
You can use the following :