2016-07-18 1 views
1

내 파일을 폴더 A에서 폴더 B로 동일한 파일 이름으로 리디렉션하고 싶습니다. EG. yourdomain.com/folderA/nosedigger.php yourdomain.com/folderB/nosedigger.php.htaccess와 동일한 이름을 가진 다른 하위 디렉토리로 리디렉션하는 방법

에 htaccess로는 yourdomain.com/folderA/.htaccess이다.

나는 다음과 같은 시도했지만 매력처럼 작동하지 않습니다. 도움이 필요하다. .htaccess의 코드가 실제로 의미하는 바가 전혀 없습니다. 이 모두를해야한다

Options +FollowSymLinks -MultiViews 

RewriteEngine On 
RewriteBase/

RewriteCond %{REQUEST_URI} !^/folderB/ [NC] 
RewriteCond %{REQUEST_URI} ^/(.*)$ 
RewriteRule^/folderB/$2 [R=301,L] 

답변

0

이 folderb하는 폴 데라에서 리디렉션하려면, 당신은 당신의 다른 규칙 위에 재를 사용할 수 있습니다

RedirectMatch ^/foldera/(.*)$ /folderb/$1 
+0

멋진 코드입니다. D : 정말 htaccess 코딩을 이해해야합니다. 감사합니다 starkeen! – OneNation

0

이 필요합니다 어쩌면

RewriteEngine On 
RewriteRule /folderA/(.*) /folderB/$1 [R=302,NC] 

:

RewriteRule ^folderA(/.*)?$ folderB$1 [R=302,NC] 
+0

나는 그것을 시도했다. 작동하지 않습니다. : – OneNation

+0

@OneNation이 또 다른 옵션을 추가했습니다 –

+0

아직 이유가 없습니다. – OneNation

관련 문제