将目录转发到域,仅删除目录的参数,而不是站点范围的参数
我将一个目录永久转发到它自己的域,我曾经在该目录中设置了一个wordpress,谷歌索引了...我已经在我的.htaccess中设置了重定向,但是永久链接结构被附加到转发的域中。因此,我将所有内容从 /sample 转发到 www.sample.com,但我想从 url 中删除未使用的变量,例如 www.sample.com/?p=6 等...但是我只需要对文件执行此操作在 /sample 目录中,因为我仍然有需要保持完整的 WordPress 安装。另外,重定向后我怎么能没有双正斜杠。我有:
Redirect permanent /sample http://www.sample.com
I'm permanently forwarding a directory to its own domain, i had a wordpress setup in the directory at one time which google indexed... I've setup the redirect in my .htaccess however permalink structure is appended to the forwarded domain. So im taking everything from /sample forwarding to www.sample.com but im wanting to strip the unused variables from the url such as www.sample.com/?p=6, etc... However i need this done only for files in the /sample directory as i still have wordpress installs that need to remain intact. Also how can i not have a double forward slash after the redirect. I have:
Redirect permanent /sample http://www.sample.com
But it outputs http://www.sample.com//
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个:
?
应该去掉查询字符串(?p=6
等)相同,但使用 mod_rewrite:
Try this instead:
The
?
should strip query string (?p=6
etc)The same but using mod_rewrite: