我的 .htaccess 中有一个简单的 mod_rewrite 规则,用于将友好的 URL 重定向到脚本
嗨,我想重写 http://www.domain.com/site_reg/index.php< /a> 到 http://www.domain.com/signup 我该怎么做。 www.domain.com 和domain.com 都适用吗?
编辑:也许我把它倒退了...用户输入 http://www.domain.com/signup 和 http://www.domain.com/site_reg/index.php 加载页
hi i'd like to rewrite http://www.domain.com/site_reg/index.php to http://www.domain.com/signup how would I do this. both for www.domain.com and domain.com?
EDIT: maybe i have it backwards... user types in http://www.domain.com/signup and http://www.domain.com/site_reg/index.php load the page
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
假设您在 VirtualHost 中设置了 ServerName 和 ServerAlias,这适用于 www.domain.com 和 domain.com
尝试:
您想要分配 301 重定向来告诉搜索引擎、浏览器等该页面已永久移动。如果移动不是永久的,请使用临时状态代码:307
This will work for both www.domain.com and domain.com, assuming you have ServerName and ServerAlias set in your VirtualHost
Try:
You want to assign a 301 Redirect to tell search engines, browsers, etc. that the page has permanently moved. If the move is not permanent, use the temporary status code: 307
尝试:
Try:
将其放入您的基本
.htaccess
中:Put this in your base
.htaccess
: