Apache的永久重定向对于字符串数据URL(问号) [英] Apache Redirect Permanent For URL with Data in String (Question Mark)

查看:276
本文介绍了Apache的永久重定向对于字符串数据URL(问号)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要寻找一个Apache重定向其中源URL中有一个问号。

I am looking for an Apache redirect where the source URL has a question mark in it.

Redirect permanent /course/view.php?id=68 http://exmaple.com/page.php

我试过逃跑的问号,但不起作用。
我读过网络上的几页关于使用重写条件,但它并没有完全意义的我,还是有人比我想要完成的有点不同。

I've tried escaping the question mark, but that doesn't work. I've read a couple pages on the web about using Rewrite conditions, however it didn't quite make sense to me, or it was a little bit different than what I wanted to accomplish.

推荐答案

尝试添加以下到您的网站的根目录下的的.htaccess 文件。

Try adding the following to the .htaccess file in the root directory of your site.

RewriteEngine on
RewriteBase / 

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /course/view\.php\?id=68 [NC]  
RewriteRule ^ http://exmaple.com/page.php [L,R=301]   

这篇关于Apache的永久重定向对于字符串数据URL(问号)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆