wckr / wocker

Create your WordPress development environment in 3 SECONDS!

Home Page:https://wocker.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Please tell me how to not forced redirect from “http: // wocker.test” to “http://wocker.dev”

echizenyayota opened this issue · comments

【Purpose of question】

Please tell me how to not forced redirect from
"http: // wocker.test" to “http://wocker.dev”.

【Supplement of question】

1.

On December 23, we upgraded the version of Wocker from 1.1.4 to 1.2.

2.

When you access “http: // wocker.test” after launching the Wocker container,
All browsers will always be redirected to “http://wocker.dev”. Also WordPress site will not be displayed (except Firefox)

3.

Personally I think there is a problem with setting up .htaccess. How to check and manipulate .htaccess in Wocker
I want to know.

4.

I’ve compiled related articles on my Japanese blog.
https://e-yota.com/webservice/wocker_test_wocker_dev_redirect/

commented

Seems DomainNameSystem problem on your host PC.
Clear DNS cache, in your host OS.
Or, Check hosts file.

Check hosts file, Example Windows
Open C:\Windows\system32\drivers\etc\hosts as a Administrator by TextEditor.

If it has settings about wocker,

10.0.23.16  wocker.dev  # VAGRANT: fc5edc866157ed6ac7e499d9b98dc696 (wocker) / 8c1a4517-3935-4e8d-a63d-da2167a12e7e

Delete this row and save. Maybe need restart Windows.

When it's normal vagrant halt , this settings is deleted by vagrant-hostsupdater.
But sometimes vagrant left hosts file settings, like when I shutdown machine while forgetting vagrant halt !

commented

Wockerを実行するホストOSのDNS設定の問題と思われます。
DNSのキャッシュ削除を試すか、hostsファイルの記載を確認してみて下さい。
ブログも拝見しました、全ブラウザで再現するのでしたらOS側の問題かと思います。

MacOS(El Capitan)でのDNSキャッシュの確認と消去
https://qiita.com/Hidehiko-Inoue/items/7b9d3bdb657c3d83095e
(Above site written in Japanese)

こちらの方法とかで調べて見て下さい。10.0.23.16 のIPアドレスが wocker.dev に紐付けられているのではないでしょうか(当方、Macを持ってませんので、ちょっとこれで正しいか検証できませんが…)

@akiya64
Thanks for the advice.
I also deleted the DNS cache in Mac OS, referring also to the official Japanese version of Apple.

$ sudo killall -HUP mDNSResponder

However, depending on the browser software, the status of URL and display was mixed.

Chrome

URL

"http: // wocker.test" is displayed. It will not be transferred to "http://wocker.dev".

WordPress (container) created in v1.1

wocker_chrome_v1 1

WordPress site where CSS is not loaded will be displayed

WordPress (container) created with v1.2

wocker_chrome_v1 2

WordPress site where CSS is also loaded will be displayed.

Firefox

URL

"http: // wocker.test" is not displayed. Forced transfer to "http://wocker.dev".

WordPress (container) created with v1.2

wocker_firefox_v1 1

WordPress site where CSS is also loaded will be displayed.

WordPress (container) created with v1.2

wocker_firefox_v1 2

WordPress site where CSS is also loaded will be displayed.


【Additional questions】

If someone knows about additional questions below please tell me.

1.

How do you apply CSS correctly in WordPress created in v1.1 while using Chrome in browser?

2.

How do I display "http: // wocker.test" without forced transfer to "http://wocker.dev" while using Firefox in the browser?


Above, thank you.

@akiya64 さん。

アドバイスありがとうございます。
Appleの日本語版公式ドキュメントも参考にして、Mac OS内のDNSキャッシュ削除しました。

$ sudo killall -HUP mDNSResponder

ですがブラウザソフトによって、URLや表示の状態がまちまちでした。

Chrome

URL

"http://wocker.test" が表示されます。"http://wocker.dev" には転送されません。

v1.1で作成したWordPress(コンテナ)

wocker_chrome_v1 1

CSSが読み込まれていないWordPressサイトが表示されます

v1.2で作成したWordPress(コンテナ)

wocker_chrome_v1 2

CSSも読み込まれたWordPressサイトが表示されます。

Firefox

URL

"http://wocker.test" が表示されません。"http://wocker.dev" には強制転送されます。

v1.2で作成したWordPress(コンテナ)

wocker_firefox_v1 1

CSSも読み込まれたWordPressサイトが表示されます。

v1.2で作成したWordPress(コンテナ)

wocker_firefox_v1 2

CSSも読み込まれたWordPressサイトが表示されます。


【追加の質問】

どなたか下記の追加の質問についてご存知の方がいらっしゃいましたらご教示願います。

1.

ブラウザでChromeを用いているときに、v1.1で作成したWordPressにおいて、どのようにすればCSSを正しく適用できるでしょうか?

2.

ブラウザでFirefoxを用いているときに、"http://wocker.dev" には強制転送されずに、"http://wocker.test" を表示させるためにはどうすれば良いでしょうか?


以上、よろしくお願い申し上げます。

commented

Windows/Macのシステムファイルであるhostsファイルの修正が必要だと思います。
Vagrantによりhostsファイルに書き込まれた設定が、消されずに残ってしまう場合があります。

hostsファイルに

10.0.23.16 wocker.dev
10.0.23.16 wocker.test

と二つの設定が記載されていれば、どちらのドメインでもWockerのWordPressへ繋がってしまいます。
私のWindowsでも移行に際して発生しました。

Macでhostsファイルを書き換える方法 HAZIMARU

V1.2とV1.2以前を混在させるのは、現状では難しいかも知れません。

CSSが読み込まれない問題は、WordPressの 一般設定 - サイトアドレス (URL) で設定しているURLと、実際にブラウザでアクセスするURLが異なる場合に発生します。
V1.1のサイトアドレス (URL) は デフォルトでhttp://wocker.dev/ が設定されていますので、V1.1で作成したWordPressでは、ダッシュボードの設定から、サイトアドレスをhttp://wocker.test/に変えてみたらどうでしょうか。

@akiya64

Thanks for frequent advice.


How about changing the site address to http: // wocker.test / from the dashboard settings?

Based on the advice you taught, I did the following three tasks.

wocker_test_2

However, where I log in to the WordPress dashboard
You can not log in to the dashboard by being forcibly redirected to "https://wocker.dev/wp-login.php".

1. Cache deletion and confirmation

chrome: // settings / clearBrowserData
chrome: // view-http-cache
...
http: //wocker.test/wp-login.php
http: //wocker.test/

2. Edit hosts file

$ cp / etc / hosts /etc/hosts.org
$ sudo vi / etc / hosts
(delete: 10.0.23.16 wocker.test # VAGRANT ...)

3. Login with wp-login.php

wocker_test_1


When logging in as "https: // wocker.test / wp - login.php"
"Issue" is to be able to access "https: // wocker.test / wp - admin" as it is.
We apologize for the frequent questions, but we would be pleased if you could tell us about this "issue".

Above, thank you.

@akiya64 さん。

たびたびのアドバイスありがとうございます。

ダッシュボードの設定から、サイトアドレスを http://wocker.test/ に変えてみたらどうでしょうか。


教えていただいたアドバイスをもとに下記の3つの作業を行いました。

wocker_test_2

ですが、WordPressのダッシュボードにログインするところで
"https://wocker.dev/wp-login.php" に強制リダイレクトされてダッシュボードにログインすることができません。

1. キャッシュの削除と確認

chrome://settings/clearBrowserData
chrome://view-http-cache
...
http://wocker.test/wp-login.php
http://wocker.test/

2. hostsファイルの編集

$ cp /etc/hosts /etc/hosts.org
$ sudo vi /etc/hosts
(delete: 10.0.23.16 wocker.test # VAGRANT...)

3. wp-login.phpでログイン

wocker_test_1


"https://wocker.test/wp-login.php" でログインしたときに、
そのまま "https://wocker.test/wp-admin" にアクセスできるようにできることが「課題」です。
たびたびの質問で恐れ入りますが、この「課題」についてご教示いただければ幸いです。

以上、よろしくお願い申し上げます。

commented

By the way, did you follow the instruction as the following link?

Wocker Tips | Wocker "How to move an old container from wocker.dev to wocker.test"
https://wckr.github.io/tips/#h2-0

If you have the issue with your old containers, I guess the tip might solve your problem.
Please refer to it, especially "4. Replace wocker.dev with wocker.test."

@ailispaw

Thank you for your comment!

Wocker Tips | Wocker "How to move an old container from wocker.dev to wocker.test"
https://wckr.github.io/tips/#h2-0

I did not see this tip. By doing the procedure described here,
Containers of v1.1 now work as usual. It really helps!

@akiya64

wocker

According to the work procedure written on the page where @ailispaw was introduced,
The v1.1 container also moved as usual, and we were able to solve this problem.
Thank you so much for frequent advice.

@akiya64 さん。

wocker

@ailispaw さんが紹介されたページに書かれている作業手順の通りにすると、
v1.1のコンテナも従来通り動くようになり、今回の問題を解決することができました。
たびたびのアドバイスをいただき、本当にありがとうございました。

I compiled this issue and its solution in my blog written in Japanese.
Even those who are not familiar with Japanese, I often use images and UNIX commands. I hope it will be helpful for everyone.
https://e-yota.com/webservice/wocker_upgrade_v1_2/