简体   繁体   English

如何重定向网址(httpd)

[英]How to redirect url (httpd)

In my Apache server I need to redirect my URL http://10.11.10.11:9003/ObiController to http://abc.co.in . 在我的Apache服务器中,我需要将URL http://10.11.10.11:9003/ObiController重定向到http://abc.co.in

How do I redirect to accomplish this ? 如何重定向以完成此操作?

For redirecting in apache with port, you can add the below line to you httpd.conf file 要使用端口重定向apache,您可以将以下行添加到httpd.conf文件中

Redirect 301 /ObiController http://abc.co.in:9003

A 301 redirect refers to the HTTP status code that is returned when a HTTP request for a specific resourse is redirected. 301重定向是指对特定资源的HTTP请求进行重定向时返回的HTTP状态代码。

Easier method is to add the following line in your .htaccess file located under your document root folder. 比较简单的方法是在文档根文件夹下的.htaccess文件中添加以下行。 This uses regular expression and checks for "ObiController" word only. 这使用正则表达式,并且仅检查“ Ob​​iController”单词。

RedirectMatch 301 ^ObiController$ http://abc.co.in

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

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