双重重定向
您好,我有一个网站,它对隐藏 url 的页面处理脚本进行 url 重写
#Direct to pageprocessor
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ pageprocessor.php?url=$1/
,然后将 url 传递到该网站,例如 http://domain.com/this/that 然后页面处理器告诉站点要显示什么。欢呼!
我的问题是,我需要添加进一步的重写,首先转到页面处理器,然后将 / 添加到给定的 url,因为用户将链接到网站等,而无需尾随 /
它需要执行 301 重定向到给定的url + /(如果不存在)。
我所有的尝试都使重定向使用传递给 pageprocessor 的 url,即
http://domain.com/this/that< /a> 变为 http://domain.com/this/pageprocessor.php?url=希望
这足够清楚很难解释:D 提前欢呼
Hi I have a site that does an url rewrite to a page processing script hiding the url
#Direct to pageprocessor
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ pageprocessor.php?url=$1/
then urls are passed to the site as such http://domain.com/this/that
page processor then tells the site what to display. hurrah!
my problem is that I need to add further rewrite to first go to page processor as it does but then add a / to the given url, as users will link to the site etc without the trailing /
it needs to do a 301 redirect to given url + / if one isn't present.
all my attempts has the redirect use the url that is passed to pageprocessor ie
http://domain.com/this/that becomes http://domain.com/this/pageprocessor.php?url=that/
hope this is clear enough is hard to explain :D
cheers in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我希望这会有所帮助
I hope this may help