2017-12-31 156 views
6

를 복제 리디렉션 www.test.local WAMP는 www.test.local HTTP과 같은 URL로 요청을 리디렉션하기로 결정 /www.test.local/ 그리고 오류가 발생합니다. 그러나 (WAMP와 함께) 주 컴퓨터에서 URL에 액세스하면 리디렉션이 발생하지 않습니다. 나는 주요 wordpress htaccess를 제거하는 것을 시도했다. 웹 사이트에 index.html 만 있으면이 문제가 발생하지 않습니다.원격 액세스 내가 로컬 네트워크의 예에 원격 장치에서 워드 프레스 웹 사이트에 액세스 할 때 URL

나는 오류 로그에서 얻을 모든 :

[www.test.local/sid#1a426ce7a18][rid#1a432dc9390/initial] [perdir C:/Users/{MyUser}/work/test/www/] strip per-dir prefix: C:/Users/{MyUser}/work/test/www/ -> 
[www.test.local/sid#1a426ce7a18][rid#1a432dc9390/initial] [perdir C:/Users/{MyUser}/work/test/www/] applying pattern '^index\\.php$' to uri '' 
[www.test.local/sid#1a426ce7a18][rid#1a432dc9390/initial] [perdir C:/Users/{MyUser}/work/test/www/] strip per-dir prefix: C:/Users/{MyUser}/work/test/www/ -> 
[www.test.local/sid#1a426ce7a18][rid#1a432dc9390/initial] [perdir C:/Users/{MyUser}/work/test/www/] applying pattern '.' to uri '' 
[www.test.local/sid#1a426ce7a18][rid#1a432dc9390/initial] [perdir C:/Users/{MyUser}/work/test/www/] pass through C:/Users/{MyUser}/work/test/www/ 
[www.test.local/sid#1a426ce7a18][rid#1a4296ec5d0/subreq] [perdir C:/Users/{MyUser}/work/test/www/] strip per-dir prefix: C:/Users/{MyUser}/work/test/www/index.php -> index.php 
[www.test.local/sid#1a426ce7a18][rid#1a4296ec5d0/subreq] [perdir C:/Users/{MyUser}/work/test/www/] applying pattern '^index\\.php$' to uri 'index.php' 
[www.test.local/sid#1a426ce7a18][rid#1a4296ec5d0/subreq] [perdir C:/Users/{MyUser}/work/test/www/] pass through C:/Users/{MyUser}/work/test/www/index.php 
[www.test.localhttp/sid#1a426ce7a18][rid#1a4334b9cc0/initial] [perdir C:/Users/{MyUser}/work/test/www/] add path info postfix: C:/Users/{MyUser}/work/test/www/www.test.local -> C:/Users/{MyUser}/work/test/www/www.test.local/ 
[www.test.localhttp/sid#1a426ce7a18][rid#1a4334b9cc0/initial] [perdir C:/Users/{MyUser}/work/test/www/] strip per-dir prefix: C:/Users/{MyUser}/work/test/www/www.test.local/ -> www.test.local/ 
[www.test.localhttp/sid#1a426ce7a18][rid#1a4334b9cc0/initial] [perdir C:/Users/{MyUser}/work/test/www/] applying pattern '^index\\.php$' to uri 'www.test.local/' 
[www.test.localhttp/sid#1a426ce7a18][rid#1a4334b9cc0/initial] [perdir C:/Users/{MyUser}/work/test/www/] add path info postfix: C:/Users/{MyUser}/work/test/www/www.test.local -> C:/Users/{MyUser}/work/test/www/www.test.local/ 
[www.test.localhttp/sid#1a426ce7a18][rid#1a4334b9cc0/initial] [perdir C:/Users/{MyUser}/work/test/www/] strip per-dir prefix: C:/Users/{MyUser}/work/test/www/www.test.local/ -> www.test.local/ 
[www.test.localhttp/sid#1a426ce7a18][rid#1a4334b9cc0/initial] [perdir C:/Users/{MyUser}/work/test/www/] applying pattern '.' to uri 'www.test.local/' 
[www.test.localhttp/sid#1a426ce7a18][rid#1a4334b9cc0/initial] [perdir C:/Users/{MyUser}/work/test/www/] RewriteCond: input='C:/Users/{MyUser}/work/test/www/www.test.local' pattern='!-f' => matched 
[www.test.localhttp/sid#1a426ce7a18][rid#1a4334b9cc0/initial] [perdir C:/Users/{MyUser}/work/test/www/] RewriteCond: input='C:/Users/{MyUser}/work/test/www/www.test.local' pattern='!-d' => matched 
[www.test.localhttp/sid#1a426ce7a18][rid#1a4334b9cc0/initial] [perdir C:/Users/{MyUser}/work/test/www/] rewrite 'www.test.local/' -> '/index.php' 
[www.test.localhttp/sid#1a426ce7a18][rid#1a4334b9cc0/initial] [perdir C:/Users/{MyUser}/work/test/www/] trying to replace prefix C:/Users/{MyUser}/work/test/www/ with/
[www.test.localhttp/sid#1a426ce7a18][rid#1a4334b9cc0/initial] [perdir C:/Users/{MyUser}/work/test/www/] trying to replace context docroot c:/Users/{MyUser}/work/test/www with context prefix 
[www.test.localhttp/sid#1a426ce7a18][rid#1a4334b9cc0/initial] [perdir C:/Users/{MyUser}/work/test/www/] internal redirect with /index.php [INTERNAL REDIRECT] 
[www.test.localhttp/sid#1a426ce7a18][rid#1a4334a4b68/initial/redir#1] [perdir C:/Users/{MyUser}/work/test/www/] strip per-dir prefix: C:/Users/{MyUser}/work/test/www/index.php -> index.php 
[www.test.localhttp/sid#1a426ce7a18][rid#1a4334a4b68/initial/redir#1] [perdir C:/Users/{MyUser}/work/test/www/] applying pattern '^index\\.php$' to uri 'index.php' 
[www.test.localhttp/sid#1a426ce7a18][rid#1a4334a4b68/initial/redir#1] [perdir C:/Users/{MyUser}/work/test/www/] pass through C:/Users/{MyUser}/work/test/www/index.php 
[www.test.localhttphttp/sid#1a426ce7a18][rid#1a4426f31f0/initial] [perdir C:/Users/{MyUser}/work/test/www/] add path info postfix: C:/Users/{MyUser}/work/test/www/www.test.localhttp -> C:/Users/{MyUser}/work/test/www/www.test.localhttp/www.test.local/ 
[www.test.localhttphttp/sid#1a426ce7a18][rid#1a4426f31f0/initial] [perdir C:/Users/{MyUser}/work/test/www/] strip per-dir prefix: C:/Users/{MyUser}/work/test/www/www.test.localhttp/www.test.local/ -> www.test.localhttp/www.test.local/ 

내 가상 호스트 파일 :

<VirtualHost *:80> 
ServerName localhost2.local 
ServerAlias *.*.local 
VirtualDocumentRoot "c:/Users/{MyUser}/work/%2/%1/" 
<Directory "c:/Users/{MyUser}/work/"> 
    ServerSignature Off 
    Options Indexes FollowSymLinks IncludesNoExec 
    AllowOverride All 
    Order allow,deny 
    Allow from all 
    # Insert the following: 
    Require all granted 
</Directory> 
</VirtualHost> 

I 표준 WP는 htaccess로 생성 사용할 경우 :

# BEGIN WordPress 
<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase/
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /index.php [L] 
</IfModule> 

# END WordPress 

결과는 것입니다을 URL은 www.test.localhttphttpttp ... 등으로 리디렉션됩니다. 한계에 도달했습니다 ... 원격 장치에서 WAMP pc IP가 프록시입니다. 리디렉션의 원래 위치는 어디입니까?

편집 : 업데이트 된 로그 - 다시 쓰기 추적을 보여줍니다. localhost 컴퓨터에서 액세스 할 때 그것은 9 행까지 동일합니다 그리고 평소처럼 자산 등을 호출합니다 ...

+0

.htaccess 파일을 포함하도록 질문을 업데이트 할 수 있습니까? – Ben

+0

@Ben .htaccess가 질문에 추가되었습니다. Apache 버전이 2.4.23 ... – Jan

+0

* .local 도메인의 다른 웹 사이트에 액세스 할 수 있습니까? 192.168.0.3 원격 장치의 IP입니까? – JBoulhous

답변

0

wordpress 구성에서 사이트 URL과 도메인 이름을 업데이트해야합니다. 이것은 이름을 기억하지 못하는 테이블에 일련 화 된 데이터로 저장됩니다.

가장 쉬운 수정 편집 index.php를하고 마지막에 추가 :

update_option('siteurl', 'http://www.test.local'); 
update_option('home', 'http://www.test.local'); 

사이트이 당신의 워드 프레스 구성을 업데이트합니다를 엽니 다. 그런 다음 해당 줄을 지우고 index.php를 그대로 둘 수 있습니다.

지우기 브라우저 캐시 또는 시크릿 모드와 오픈 www.test.local

+0

문제가되지 않는 것 같습니다 ... 스크립트가 업데이트 될 수 있고 wp-config.php에서 이러한 옵션을 정의한 위치에 스크립트가 도달하면 사이트가 이미 리디렉션되었습니다 ... 업데이트 된 로그는 대답은 더 많은 것을 말해 줄 수 있습니다 ... – Jan

+0

리디렉션을 캐싱했을 수 있습니다. 다른 브라우저 또는 시크릿 모드 – albert

+0

으로 시도해보십시오. 물론 시도해 보았습니다 ... – Jan

2

편집을 사용 : 질문에 대한 업데이트가 분명히으로이 문제 될 것 같지 않습니다. 아직도 유용하다고 생각하는 임의의 Google 직원을 위해이 위치를 남깁니다. -

당신은 당신의 wp_options 테이블에 'http://www.test.local/'(모두 같은 값)의 'option_value에'상기 option_name 년대 '집'과 'SITEURL를 업데이트 할 수 있습니다

귀하의 워드 프레스 사이트의 URL을 업데이트하려면

 UPDATE [yourWPDB].wp_options 
    SET option_value='http://www.test.local/' 
    WHERE option_name = 'home' OR option_name = 'siteurl' 

또한 업데이트하기 위해 워드 프레스 루트에 WP-config.php 파일에 다음 줄을 추가 할 수 있습니다 -

 define('WP_SITEURL', 'http://www.test.local/'); 
    define('WP_HOME', 'http://www.test.local/'); 
0

이 유 시도 pdating 옵션 값 'siteurl'=> 'http://www.test.local'); 'home'=> 'http://www.test.local'데이터베이스 (wp_options) 테이블에서 URL의 끝에 슬래시를 넣지 마십시오. 예 : www.test.local/..백엔드에서 permalink를 재설정하십시오.