#12758 closed defect (bug) (fixed)
Better server checks in network.php
Reported by: | nacin | Owned by: | |
---|---|---|---|
Milestone: | 3.0 | Priority: | high |
Severity: | normal | Version: | |
Component: | Multisite | Keywords: | has-patch needs-testing |
Focuses: | Cc: |
Description
network.php makes careful double-checks (literally) for mod_rewrite in step 1, but nothing in step 2 when it actually presents the rules.
We should be able to detect mod_rewrite in step 2. If they're not running Apache at all, they probably don't need the Apache rules.
Additionally, we need IIS detection and support in both steps.
Attachments (3)
Change History (30)
#2
@
14 years ago
- Keywords has-patch needs testing added; needs-patch removed
There's just one problem with the .diff is the content portion which i've commented on, otherwise it's working on my end where the network page displays the appropriate rules for.
Another thing it would be nice if I could call the function iis7_url_rewrite_rules from inside of the network.php file, unfortunately I do not know how to call functions inside of a class.
#4
@
14 years ago
- Keywords needs-patch added; has-patch needs-testing removed
Found some bugs in the url rewrite diff, fixing them now.
#5
@
14 years ago
- Cc ruslany westi added
Please don't do this:
$indent.$indent.$indent
It makes it really hard to read.
Much better to just use a multi-line string.
If this doesn't get a patch in the next couple of days it will likely miss 3.0
#7
@
14 years ago
No, identation does not affect the IIS runtime. The reason identation is added is so that the rules preview in the Options -> Permalinks page and in the generated configuration file look nice with proper XML indentation.
#8
@
14 years ago
Well the problem with what I wrote above in that .diff is that the "mainsite" url doesnt transfer 404's, the subsites, mulsitesites off of the main site work just fine.
#10
@
14 years ago
Alright I figured it out, it's in the wordpress code someplace that the problem is, why? cause this is why.
{{{define('VHOST', 'yes');
If VHOST is 'yes' uncomment and set this to a URL to redirect if a blog does not exist or is a 404 on the main blog. (Useful if signup is disabled)
For example, the browser will redirect to http://examples.com/ for the following: define( 'NOBLOGREDIRECT', 'http://example.com/' );
Set this value to %siteurl% to redirect to the root of the site
define( 'NOBLOGREDIRECT', 'http://frumph.net' );
On a directory based install you must use the theme 404 handler.
}}}
If I uncomment the define( no blog redirect, which it was it will have the problem where the main site doesnt go to the 404 error page. if I keep it there, the url rewrite rules I wrote above will work fine.
@
14 years ago
Okay this is all working, subdirectory, subdomain and shows the info in the network panel.
#13
@
14 years ago
That all works. The problem we have is that the NOBLOGREDIRECT served a dual purpose of both no blog and 404 redirect. As much as I hate to do it, we're going to have to add another constant.
#15
@
14 years ago
To prevent the 404 redirect add
define( 'NO404REDIRECT', true );
I wanted to get the patch in before RC, but the
$indent.$indent.$indent
has to be addressed before closing the ticket.
#16
@
14 years ago
That doesn't get fired until template_redirect, so surely we can use a filter here instead...
#17
@
14 years ago
What would be best would be the display in the network panel how it displays what to put in the web.config should be generated by the same code that actually does it so it doesn't double up on the information. But that can be an update for 3.1 and I can work on that., for now ron's new define works.
#20
follow-up:
↓ 21
@
14 years ago
You do know the indents were there to make things display properly in the networks panel right?
#21
in reply to:
↑ 20
@
14 years ago
Replying to Frumph:
You do know the indents were there to make things display properly in the networks panel right?
The indents are directly in the strings now.
#23
@
14 years ago
I;m going to apply another improvement to this one and mark it as fixed. If something shows up re-open the ticket.
Rewrite Rules changes and check for IIS / apache for the network page.