简体   繁体   English

使用htaccess将www.url.com/x=y重定向到www.url.com/file.php?x=y?

[英]Redirect www.url.com/x=y to www.url.com/file.php?x=y with htaccess?

I realize this question is really poorly formed but that's why I am asking it; 我知道这个问题的形成确实很糟糕,所以这就是为什么我要问这个问题。 I wouldn't know how to type this in google. 我不知道如何在Google中键入此内容。

I want to redirect: 我想重定向:

www.url.com/x=2

to: 至:

www.url.com/file.php?x=2

Use this 用这个

 Redirect 301 /x=2 www.url.com/file.php?x=2

EDIT 编辑

If you need to mass-redirect a group of links you would probably need to use the RedirectMatch directive. 如果您需要批量重定向一组链接,则可能需要使用RedirectMatch指令。

RedirectMatch ^/x=(.*)$ /file.php?x=$1

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Javascript代码示例中使用变量:src =“ htp://www.url.com/file.php?id = [3434]” - How To Use Variable In Javascript Code Ex: src=“htp://www.url.com/file.php?id=[3434]” 结合来自url.com和www.url.com的喜欢 - Combining likes from url.com and www.url.com 使用CURL进行下载而无需直接路径| www.url.com/things?download=文件 - Using CURL to download without a direct path | www.url.com/things?download=file Laravel-Azure DNS-网站网址问题(url.com有效,www.url.com无效) - Laravel - Azure DNS - Website url issues (url.com works , www.url.com does not) .htaccess将url.com/file.php?=$terms重定向到newurl.com/search.php?= $ terms(如果引荐来源网址不是site.com) - .htaccess redirect url.com/file.php?=$terms to newurl.com/search.php?=$terms if referrer is not site.com 需要使用 www.mydomain.com/filename/ 而不是 www.mydomain.com/file.php?id=1 - need to use www.mydomain.com/filename/ instead of www.mydomain.com/file.php?id=1 Htaccess URL将www.website.com/info/index.php重写为info.website.com - Htaccess URL rewrite www.website.com/info/index.php to info.website.com 使用htaccess将网址www.xyz.com/index.php?id=xyz重写为www.xyz.com/xyz - rewrite url www.xyz.com/index.php?id=xyz to www.xyz.com/xyz using htaccess 如何使用.htaccess url.tld / file.php重定向到url.tld / file.php / - how to redirect with .htaccess url.tld/file.php to url.tld/file.php/ htaccess将非www重定向到www URL - htaccess redirect non www to www URL
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM