重定向.htaccess文件 [英] Redirect .htaccess file

查看:113
本文介绍了重定向.htaccess文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我想重定向.htaccess而不更改网址!

示例:

http://demo.example.com/

它应显示以下内容:

http://demo.test.com/

但URL保持http://demo.example.com/



我搜索了很多,它总是重定向更改URL ..



RewriteEngine On

RewriteCond%{HTTP_HOST} ^ demo \.example\.com $

RewriteRule ^(。*)http:\ / \ / demo \ .test \'$ 1 [P]



谢谢..

Hello everyone,

I want to redirect on .htaccess without changing the URL!
Example:
http://demo.example.com/
It should display the content of:
http://demo.test.com/
But the URL stays "http://demo.example.com/"

I was searching a lot and it always redirects changing the URL..

RewriteEngine On
RewriteCond %{HTTP_HOST} ^demo\.example\.com$
RewriteRule ^(.*) http:\/\/demo\.test\.com$1 [P]

Thank you..

推荐答案



RewriteRule ^(。*)http:\ / \ / demo \ .test \.com

RewriteRule ^(.*) http:\/\/demo\.test\.com


1 [P]



谢谢..
1 [P]

Thank you..


看看下面的URL,如果那是什么你正在寻找。



https://www.addedbytes.com/articles/for-beginners/url-rewriting-for-beginners/ [ ^ ]
Have a look at the below URL if that's what your looking for.

https://www.addedbytes.com/articles/for-beginners/url-rewriting-for-beginners/[^]


这篇关于重定向.htaccess文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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