byorgey
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: URL problem after upgrade on virtual hostAfter much struggling I was able to get it fixed; everything seems to be working well now but I’m not sure if I fixed it in the “right” way! =)
It turns out there were two problems. First, the server was reporting the REQUEST_URI strangely. I’ve had this problem before, and fixed it, but for some reason something changed slightly so I had to re-fix it. Essentially I had to edit wp-settings.php so that it deleted /~byorgey/wordpress/ from the REQUEST_URI. Once I fixed that, it got stuck in an infinite redirect… http://www.mathlesstraveled.com redirected to http://www.mathlesstraveled.com, which redirected to… and so on. I finally was able to fix this by commenting out the line
do_action(‘template_redirect’);
in wp-includes/template_loader.php. I have no idea what this line is supposed to do, so I don’t know if commenting it out is a good idea (I found it by grepping the entire source tree for ‘redirect’), but it seemed to fix things, so…
Forum: Fixing WordPress
In reply to: URL ProblemsI was having a similar problem — my blog is located at http://www.mathlesstraveled.com, but it’s set up as a virtual host. The problem I found was that PHP was reporting a strange value for REQUEST_URI: A page such as mathlesstraveled.com/page.php would have a reported REQUEST_URI of /~byorgey/wordpress/page.php (instead of just /page.php), which was the directory it resided in as far as the server was concerned, but of course doesn’t work if you type it in the URL bar of a browser. I was able to get around this with a hack, adding the following line to wp-settings.php:
$_SERVER['REQUEST_URI'] = str_replace('/%7Ebyorgey/wordpress/', '', $_SERVER['REQUEST_URI']);(Of course that should all be one line.) Probably not the best way to solve the problem, but it works. Of course if you do this you should replace
/%7Ebyorgey/wordpress/withjason/or whatever is appropriate.