Opened 13 years ago
Closed 13 years ago
#15083 closed defect (bug) (fixed)
Apache rewrite loop on subdirectory install
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 3.1 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Multisite | Keywords: | has-patch commit |
Focuses: | Cc: |
Description (last modified by )
If a requested file under the wp-content directory does not exist, this creates a rewrite loop for the file. Let's say /subsite/wp-content/themes/theme-x/images/abc.gif
does not exist, then the rewrite that is invoked is:
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
The first rewrite pass rewrites the url to /wp-content/themes/theme-x/images/abc.gif
which also does not exist. However, the rewritten request still matches the rewrite rule because the question mark ^([_0-9a-zA-Z-]+/)?
makes it so the rewrite rule also applies to /wp-content/themes/theme-x/images/abc.gif
.
Attachments (5)
Change History (13)
#3
follow-up:
↓ 4
@
13 years ago
I smells like the ? is needed for the /. And then while taking a look in the code: What about the uploaded files? Don't they have the same pattern that you're about?
@
13 years ago
Seperatred Concerns first by refactoring htaccess content generation into a function of it's own and by using template variables instead of mixing template and code (at least a bit more than previsously)
#4
in reply to:
↑ 3
@
13 years ago
Replying to hakre:
I smells like the ? is needed for the /. And then while taking a look in the code: What about the uploaded files? Don't they have the same pattern that you're about?
No, the ? is not needed for the /. The rewrite base is / (or /path-to-wp-install/), so in /subsite/wp-content/... what is being rewritten is subsite/wp-content/...
In contrast, the /files rewrite has to be processed whether or not there is a leading subsite path which is why I did not change it.
#5
follow-up:
↓ 6
@
13 years ago
- Keywords commit added
- Milestone changed from Awaiting Review to 3.1
wpmuguru -- this looks valid. No reason to try to redirect the root blog (which was the point of the ?) because /wp-load.php will exist, and we're only looking for files that are virtual like /subsite/wp-load.php.
Should be good on http://core.trac.wordpress.org/attachment/ticket/15083/15083.diff.
I don't have IIS to work with so I did not patch those rules. If someone with IIS could makes similar changes to the IIS rules, that would be great.