.htaccess 和子域问题的 URL 重写
我有以下重写规则:
RewriteCond ${rewrite_map:$1|NOT_FOUND} !NOT_FOUND
RewriteRule ^([a-zA-Z0-9_-]+)/?$ index.php?shop_id=${rewrite_map:$1} [NC,L,QSA]
因此该 URL 如下所示: http://www.domain.com /company-name/
嗯,我正在开发 iPad 版本,因此我重定向到:http://m. domain.com/ 工作正常,但是当我转到 URL http://m.domain.com/company-name/ 我收到页面未找到错误。 m 子域是从我的 /ipad 目录中提取的。如果我转到 http://www.domain.com/ipad/company-name/ 这也有效。我只需要它也能在我的移动子域上工作。
有谁知道我需要添加什么才能使这项工作正常进行?
谢谢你!
I have the following Rewrite Rule:
RewriteCond ${rewrite_map:$1|NOT_FOUND} !NOT_FOUND
RewriteRule ^([a-zA-Z0-9_-]+)/?$ index.php?shop_id=${rewrite_map:$1} [NC,L,QSA]
So the URL for that looks like: http://www.domain.com/company-name/
Well I am developing an iPad version so I am redirecting to: http://m.domain.com/ which works fine but when I go to the URL http://m.domain.com/company-name/ I get a Page Not found error. The m subdomain is pulling from my /ipad directory. If I go to http://www.domain.com/ipad/company-name/ THAT works as well. I just need it to work on my mobile subdomain as well.
Does anyone know what I need to add to make this work?
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于任何感兴趣的人,我通过将以下内容添加到我的 htaccess 文件中来解决这个问题:
For anyone interested, I figured it out by adding the following to my htaccess file: