Skip to content

Commit

Permalink
Merge pull request #1136 from xwp/fix/local-htaccess
Browse files Browse the repository at this point in the history
Add .htaccess required for the local WP container
  • Loading branch information
kasparsd authored Jul 9, 2020
2 parents c04a05e + 3f1b4a0 commit b94ce31
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ services:
- .:/var/www/html/wp-content/plugins/stream-src # Working directory.
- ./build:/var/www/html/wp-content/plugins/stream # Built version for testing.
- ./local/public:/var/www/html # WP core files.
- ./local/config/.htaccess:/var/www/html/.htaccess
- ./local/config/wp-cli.yml:/var/www/html/wp-cli.yml
- ./local/config/wp-config.php:/var/www/html/wp-config.php
- ./local/config/wp-tests-config.php:/var/www/html/wp-tests-config.php
Expand Down
16 changes: 16 additions & 0 deletions local/config/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# For a subdirectory multisite
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
# END WordPress

0 comments on commit b94ce31

Please sign in to comment.