简体   繁体   English

apache .htaccess使用modrewrite重定向

[英]apache .htaccess redirect with modrewrite

I need some help making a redirect for a request like 123.456.789.10/x/y/... to a certain domain hosted on the same server lets say domain.com/x/y/... 我需要一些帮助,例如将123.456.789.10/x/y/...重定向到同一服务器上托管的某个域,例如domain.com/x/y/...

Any help would be appreciated. 任何帮助,将不胜感激。

Use something like this: 使用这样的东西:

RewriteCond %{HTTP_HOST} 123\.456\.789\.10
RewriteRule ^x/y/ http://domain.com%{REQUEST_URI} [NE,R=301,L]

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM