forked from bigbite/wp-cypress
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: create a multisite htaccess file when enabled
htaccess files require different configuration depending on whether multisite is enabled and based on which type - subfolder or subdomain. Previously only a single site htaccess file was created no matter the config. To correct this I've introduced two multisite .htaccess templates that will be used when their type is selected. * Added subdomain .htaccess * Added subfolder htaccess * Change dockerfile tempalte to use htaccess name variable * Change config creation to pass htaccess file name to template
- Loading branch information
1 parent
0227fd2
commit bea9559
Showing
5 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# WP-Cypresss Multisite Subdomain | ||
# This file is a template for the WP-Cypress package. It will be renamed to `.htaccess`. | ||
# BEGIN WordPress | ||
# The directives (lines) between `BEGIN WordPress` and `END WordPress` are | ||
# dynamically generated, and should only be modified via WordPress filters. | ||
# Any changes to the directives between these markers will be overwritten. | ||
RewriteEngine On | ||
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] | ||
RewriteBase / | ||
RewriteRule ^index\.php$ - [L] | ||
|
||
# add a trailing slash to /wp-admin | ||
RewriteRule ^wp-admin$ wp-admin/ [R=301,L] | ||
|
||
RewriteCond %{REQUEST_FILENAME} -f [OR] | ||
RewriteCond %{REQUEST_FILENAME} -d | ||
RewriteRule ^ - [L] | ||
RewriteRule ^(wp-(content|admin|includes).*) $1 [L] | ||
RewriteRule ^(.*\.php)$ $1 [L] | ||
RewriteRule . index.php [L] | ||
# END WordPress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# WP-Cypresss Multisite Subfolder | ||
# This file is a template for the WP-Cypress package. It will be renamed to `.htaccess`. | ||
# BEGIN WordPress | ||
# The directives (lines) between `BEGIN WordPress` and `END WordPress` are | ||
# dynamically generated, and should only be modified via WordPress filters. | ||
# Any changes to the directives between these markers will be overwritten. | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters