本文介绍了mod_rewrite与?在原始网址(例如YouTube)中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,我想模拟YouTube URL并将其重定向到我的真实URL.原因是我使用随机字符串制作了视频ID,因此无法按顺序猜测它们.我也有链接

Ok I want to simulate the YouTube URL and redirect it to my real URL. Reason being is I used a random string to make video ID's so they aren't guessable by sequence. I have the links as so

http://www.mysite.com/watch?v=Dxdotx3iT1

并想要重定向到

http://www.mysite.com/index.php?page=videos&section=view&v=Dxdotx3iT1

似乎无法弄清楚mod重写.还使用?我相信告诉它做点什么.

Can't seem to figure out the mod rewrite. Also using a ? I believe tells it to do something.

任何帮助将不胜感激.

推荐答案

您需要使用[QSA](附加查询字符串)标志来调整RewriteRule以包括查询字符串:

You need to adjust your RewriteRule to include the query string using the [QSA] (query string attached) flag:

RewriteRule ^watch$ index.php?page=video&section=view [QSA]

这篇关于mod_rewrite与?在原始网址(例如YouTube)中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-31 09:58