帮助.htaccess重定向并访问原始目录。 [英] Help with .htaccess redirecting with access to original directories.

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

问题描述

我真的遇到了.htaccess问题,想知道是否有人可以提供帮助?我在服务器上有一个网址,需要重定向到另一台服务器上的另一个网址。需要访问原始网址中的三个目录,因此无需转移。



我尝试过的方法:



我尝试过以下方法:



选项+ FollowSymLinks

RewriteEngine On

Rewritecond%{http_host} ^ originalurl\.com [NC]

RewriteCond%{REQUEST_URI}!^ /(downloads | Footer | newsletters)/ [NC]

Rewriterule ^(。*)$ http://newurl.info/$1 [L,R = 301]



转移不会发生并且可以访问目录给出错误。以下版本工作正常但只有一个目录访问而不是三个。





选项+ FollowSymLinks

RewriteEngine on

RewriteRule!^ downloads($ | /)http://www.newurl.info/ [L,R = 301]



非常感谢任何帮助。

Hi I'm really stuck with an .htaccess problem and wondered if anyone could help? I have a url on a server which needs to redirect to another url on a different server. Three directories from the original url need to be accessed so no divert.

What I have tried:

I have tried the following:

Options +FollowSymLinks
RewriteEngine On
Rewritecond %{http_host} ^originalurl\.com [NC]
RewriteCond %{REQUEST_URI}!^/(downloads|Footer|newsletters)/ [NC]
Rewriterule ^(.*)$ http://newurl.info/$1 [L,R=301]

The divert does not occur and and access to the directories gives an error. The following version works ok but with only one directory access rather than three.


Options +FollowSymLinks
RewriteEngine on
RewriteRule !^downloads($|/) http://www.newurl.info/ [L,R=301]

Any help would be very much appreciated.

推荐答案

http://newurl.info/
http://newurl.info/


1 [L, R = 301]



转移不会发生,并且访问目录会出错。以下版本工作正常但只有一个目录访问而不是三个。





选项+ FollowSymLinks

RewriteEngine on

RewriteRule!^ downloads(
1 [L,R=301]

The divert does not occur and and access to the directories gives an error. The following version works ok but with only one directory access rather than three.


Options +FollowSymLinks
RewriteEngine on
RewriteRule !^downloads(


| /)http://www.newurl.info/ [L,R = 301]



非常感谢任何帮助。
|/) http://www.newurl.info/ [L,R=301]

Any help would be very much appreciated.


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

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