[wp-trac] [WordPress Trac] #26885: Path Based Multisite Rewrite rule absolute path without trailing slash
WordPress Trac
noreply at wordpress.org
Thu Jan 23 19:57:22 UTC 2014
#26885: Path Based Multisite Rewrite rule absolute path without trailing slash
-------------------------------------------+------------------------------
Reporter: skalex | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Multisite | Version: 3.8
Severity: minor | Resolution:
Keywords: needs-patch reporter-feedback |
-------------------------------------------+------------------------------
Comment (by skalex):
The links attemped for the CSS and JS are fine and now working correctly.
i.e. http://www.example.com/test/wp-includes/css/dashicons.min.css?ver=3.8
The problem is the .htaccess rewrite rules, they failed, so the Apache
could not find the files. I have fixed it modifing them in the .htaccess,
but the bug I am reporting is that the generated code must be okay, it
must not require aditional modifications. The .htacceess generated code
was
RewriteEngine On
RewriteBase /pages/
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).*)
var/www/site/$2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ var/www/site/$2 [L]
RewriteRule . index.php [L]
As you can see, the path is incorrect, because is missing a trailing
slash. It must be changed to from "var/www/site/$2" to "/var/www/site/$2"
to make it absolute. Other way, I also fixed it setting to "$2", a
relative path.
I have looked at the network.php, I think the problem is on the
$rewrite_base variable. I don't understand why the trailing slash are
removed
$rewrite_base = ! empty( $wp_siteurl_subdir ) ? ltrim(
trailingslashit( $wp_siteurl_subdir ), '/' ) : '';
Now, I have changed the site URL, so the $rewrite_base is setted to ""
(wich is correct to make a relative path). I can't reproduce now the bug,
cause I continue with my site construction. If I can reproduce it I will
add the details.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/26885#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list