sitecrafting / conifer

:evergreen_tree: A powerful WordPress library plugin for OO development
https://www.coniferplug.in
MIT License
18 stars 2 forks source link

Support pretty URLs out of the box #35

Open philmprice opened 6 years ago

philmprice commented 6 years ago

[ Overview ] I encountered an issue visiting pretty URLs in a fresh start of Conifer on Lando, but resolved it with an .htaccess file.

[ Steps to reproduce ]

  1. In terminal, run: git clone git@github.com:/sitecrafting/conifer && cd conifer lando start
  2. In browser, visit /sample-page/ at your domain (ie. http://conifer.lndo.site:8000/sample-page/)

[ Expected result ] Sample page would display in browser

[ Experience result ] White screen apache error screen appears saying: Not Found The requested URL /sample-page/ was not found on this server. Apache/2.4.10 (Debian) Server at conifer.lndo.site Port 8000

[ Tried solution ] If I put the following in new file /wp/.htaccess, the page displayed correctly:

# 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

[ Lando start output ] Here is the output I captured from 'lando start'

pprice-mbpro2:conifer pprice$ lando start
Creating network "landocasetupkenobi38ahsokaf5fb260d93ff852fa89e0c3f2721fd2de9e40757_default" with the default driver
Creating landocasetupkenobi38ahsokaf5fb260d93ff852fa89e0c3f2721fd2de9e40757_ca_1 ... done
Looks like you do not have a Lando CA yet! Let's set one up!
Trying to setup root CA with...
LANDO_CA_CERT: lando.pem
LANDO_CA_KEY: lando.key
CA_CERT: /certs/lando.pem
CA_KEY: /certs/lando.key
/certs/lando.pem not found... generating one
Generating RSA private key, 2048 bit long modulus
..................+++
.......................+++
e is 65537 (0x10001)
/certs/lando.pem not found... generating one
CA generated at /certs/lando.pem
Killing landocasetupkenobi38ahsokaf5fb260d93ff852fa89e0c3f2721fd2de9e40757_ca_1 ... done
Removing landocasetupkenobi38ahsokaf5fb260d93ff852fa89e0c3f2721fd2de9e40757_ca_1 ... done
Creating network "landoproxyhyperion5000gandalfedition_edge" with driver "bridge"
Creating landoproxyhyperion5000gandalfedition_proxy_1 ... done
Creating network "conifer_default" with the default driver
Creating volume "conifer_data" with default driver
Creating volume "conifer_appserver" with default driver
Creating volume "conifer_data_database" with default driver
Creating conifer_node_1       ... done
Creating conifer_phpmyadmin_1 ... done
Creating conifer_mailhog_1    ... done
Creating conifer_database_1   ... done
Creating conifer_appserver_1  ... done
Waiting until phpmyadmin service is ready...
Waiting until mailhog service is ready...
Waiting until appserver service is ready...
Waiting until database service is ready...
Waiting until node service is ready...
Waiting until database service is ready...

....

yarn install v1.6.0
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 130.86s.

BOOMSHAKALAKA!!!

Your app has started up correctly.
Here are some vitals:

 NAME             conifer                                        
 LOCATION         /Users/pprice/workspace/conifer                
 SERVICES         appserver, database, node, phpmyadmin, mailhog 
 APPSERVER URLS   https://localhost:32771                        
                  http://localhost:32772                         
                  http://conifer.lndo.site:8000                  
                  https://conifer.lndo.site:444                  
 PHPMYADMIN URLS  http://localhost:32769                         
 MAILHOG URLS     http://localhost:32768                         
                  http://mail.conifer.lndo.site:8000             
                  https://mail.conifer.lndo.site:444   
acobster commented 6 years ago

@philmprice I confirmed that it should do this out of the box so I've labelled this as a bug. Can you tell me what happens when you destroy the app and start fresh?

lando destroy -y
lando start -- -vvv

I should only need the output starting after it prompts you for URLs and stuff. Thanks!