Closed flexseth closed 2 months ago
Hi @flexseth, not sure I follow 😅 Can you elaborate on the why?
Also, spoofing the hosts file from Playground isn't technically possible.
I tried getting this to work based on the instructions available in the wp-now
documentation, did not seem to work.
## Playground ##
http://127.0.0.1:8881 http://myurl.wpnow:8881
{
"steps": [
{
"step": "defineWpConfigConsts",
"consts": {
"WP_HOME": "http://myurl.wpnow:8881",
"WP_SITEURL": "http://myurl.wpnow:8881"
},
"method": "define-before-run"
}
]
}
npx
commandnpx @wp-now/wp-now start --blueprint=blueprint.json
This site can’t be reached
Check if there is a typo in myurl.wpnow.
DNS_PROBE_FINISHED_NXDOMAIN
errors: 'PHP Warning: Constant WP_HOME already defined in /var/www/html/wp-config.php on line 2\n' +
'PHP Warning: Constant WP_SITEURL already defined in /var/www/html/wp-config.php on line 3\n' +
'PHP Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-config.php:2) in /var/www/html/wp-login.php on line 504\n' +
I ran this in "WordPress" mode - IE: no files or folders except the blueprint.json
file.
Hey @flexseth, the hosts file should look like this (without the protocol and port number):
127.0.0.1 myurl.wpnow
Can you see if it works?
Hey @flexseth, the hosts file should look like this (without the protocol and port number):
127.0.0.1 myurl.wpnow
This works, but throws the error
Warning: Constant WP_HOME already defined in /var/www/html/wp-config.php on line 2 Warning: Constant WP_SITEURL already defined in /var/www/html/wp-config.php on line 3
Feel like this has been addressed somewhere.
I'll mark this as closed, there will probably be a good solution for handling URLs at some point.
@flexseth, you can try resetting the project (see wp-now
README):
--reset
Probably better to open a separate issue in the playground-tools repo, though.
Blueprint idea: make a website that spoofs the URL bar
User goes to
reallycoolobjects.com
and it looks like their websiteTheir hosts file is tricked, but it makes demonstration so much better.
The challenge
Here's a bad idea....
@ironnysh - you're good with
wp-now
;)I've got a scenario for you:
theme1
foldertheme2
folderhosts
via a blueprintThe steps should include how to set up VS Code for the instance.
And yes, the user will have to edit their
hosts
file.End result
hosts
fileie: user's website is called
Really Cool Objects
the URL bar could show
reallycoolobjects.com
Why?
Being able to customize the perceived URL is a huge benefit in many ways.
Extra Credit
Show how to save developer workspaces in VS Code
Make
theme1
go todev.reallycoolobjects.com