Can access WP Dashboard and home page, but not post pages

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Can access WP Dashboard and home page, but not post pages

Postby DigitalDoyle » 05. November 2009 17:23

I've been happily using xampplite for a couple of months now on my local development desktop machine and also on a separate development installation on a USB thumb drive on my laptop with no problems. Xampp is just what I needed. Easy to install and easy to use.

But late last night I was using Windows Live Writer to write a post on the laptop installation, like I've done tons of times, and it published correctly and launched the site site in Firefox to let me see it. No problem. The post showed up on the home page just as I expected. But I wanted to check an earlier post and when I clicked on it from the home page I was presented with a dialog that said:

"Authentication required!

This server could not verify that you are authorized to access the URL "/xampp/". You either supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.

In case you are allowed to request the document, please check your user-id and password and try again.

If you think this is a server error, please contact the webmaster.
Error 401
localhost
11/05/09 08:43:49
Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9 "


That was completely out of pattern. I'd never seen that before. It had my login and password in the fields, so I clicked the OK button and was taken to the xampp Welcome page and not the post page I wanted. I went back to the main page and tried again and this time I was immediately redirected to the xampp Welcome page.

I logged into the WP dashboard and everything was fully functional. I could see all the posts. But if I try to launch them in a new tab, I always get that redirect. I can log in and access the phpMyAdmin and get access to the database with no problem.

I spent several hours last night and this morning searching the forum and the web for answers and found out about checking the error and access logs. Very helpful. I seem to be getting a 302 redirect, for some reason, on the post pages. My access log shows this when I try to access a post:

127.0.0.1 - - [05/Nov/2009:08:34:08 -0600] "GET /wordpress/2009/03/testing-sunday-morning-esosoft-fix/ HTTP/1.1" 302 -
127.0.0.1 - - [05/Nov/2009:08:34:08 -0600] "GET /xampp/ HTTP/1.1" 401 1336

That's the point where the dialog happens the first time I try to access a post after starting Apache and MySql with control.exe. After that it shows this when I access a post (but typical of any post):

127.0.0.1 - - [05/Nov/2009:10:10:47 -0600] "GET /wordpress/2009/03/testing-sunday-morning-esosoft-fix/ HTTP/1.1" 302 -
127.0.0.1 - DDdev [05/Nov/2009:10:10:47 -0600] "GET /xampp/ HTTP/1.1" 200 604
127.0.0.1 - DDdev [05/Nov/2009:10:10:47 -0600] "GET /xampp/head.php HTTP/1.1" 200 1393
127.0.0.1 - DDdev [05/Nov/2009:10:10:47 -0600] "GET /xampp/start.php HTTP/1.1" 200 1015
127.0.0.1 - DDdev [05/Nov/2009:10:10:47 -0600] "GET /xampp/navi.php HTTP/1.1" 200 3132

I had the idea this morning to check the desktop machine's behavior and compare it to help track down the problem, but found that it too is now doing the exact same thing as my laptop installation.

I had Microsoft updates come in for both machines yesterday and Firefox also had some updates in the past day or two, and that made me wonder if that might be a factor. I couldn't find anywhere in the forum or googling where anyone had this exact situation or problem. That usually means I've done something stupid.

Does anyone have any idea why this might be happening out of the blue like this on two different machines with two different and separate xampp setups?

I'm using:
Windows XP SP3 fully updated and patched on both machines
XAMPP Version 1.7.1 just as it comes in the install with no mods other than the security measures recommended.
Wordpress v2.8.5 (updated earlier this week prior to this odd behavior)

Thanks for any light you might be able to shed on this. Much appreciated.
DigitalDoyle
 
Posts: 4
Joined: 05. November 2009 16:36

Re: Can access WP Dashboard and home page, but not post pages

Postby Izzy » 06. November 2009 06:27

Windows auto updates, yuk!

I'll take a stab in the dark here.

Have a look through any .htaccess files that may be present in your folders and see if they can shed some light on these 302 redirect and authentication issues.

To narrow the search a tad you can sort your files in date order in Explorer and then look for changed files about the date and time that this phenomenon started.
Wordpress v2.8.5 (updated earlier this week prior to this odd behavior)
This has to be a major suspect - have you checked out the Wordpress forums re this latest update for possible reported bugs or changes especially in any of the associated .htaccess files?

Good luck
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: Can access WP Dashboard and home page, but not post pages

Postby DigitalDoyle » 06. November 2009 09:19

Thanks for the response, Izzy!

I'll do as you suggest, but I thought it was very odd that with such a plain vanilla xampplite install this would suddenly happen on two different machines. And that if it was happening to me, surely there must be others that are affected.

I'll check on the WP and Thesis (WP framework I use for client site development) forums and see if anyone else is having problems like this.

Thanks again! If anyone else has any ideas of what could be causing this, please chime in. I am shooting in the dark with this one.
DigitalDoyle
 
Posts: 4
Joined: 05. November 2009 16:36

Re: Can access WP Dashboard and home page, but not post pages

Postby DigitalDoyle » 06. November 2009 22:17

Woot! :D

Following Izzy's advice to check the dates on all the .htaccess files I discovered that only one of them had been changed, and it changed this past Monday just after lunch. The exact time I upgraded my Wordpress installation to v2.8.5. Since I backed up the entire installation prior to making the update, I went back and compared the C:\xampplite\htdocs\wordpress\.htaccess file to the recently updated one and found it had an extra block of entries, just above and in addition to the one that matched the old file. Like so:

Code: Select all
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>

# END WordPress


I saved off the above info, in case I screwed things up, and then deleted the top part, leaving the file in the same state as the older one that was working, shut down xampp and restarted it, and viola! My installation works again! I can access the rest of the site as normal, rather than just the home page. Excellent!

I don't know what that first block is doing to cause the problem, exactly, as I'm still new to this Apache .htaccess stuff, but deleting it made everything work again. Perhaps someone could comment on why that block caused the redirect to the xampp Welcome page?

And that also explains why my laptop installation had the exact same problem. My usb thumb drive (that I use on the laptop) has too slow an access time (I'm guessing) and wouldn't allow the full automatic update to WP v2.8.5 to finish. It would unpack the files and just stop every time I tried. The installation on my desktop had no problem updating, so I copied the WP v2.8.5 install from there to the thumb drive and updated my wp-config.php file, swapped out my Thesis theme files and plugin folder from the laptop's backup to complete the update.

After making the same changes on the laptop, it too is back to normal.

Thanks for the help, Izzy! You ROCK!
DigitalDoyle
 
Posts: 4
Joined: 05. November 2009 16:36

Re: Can access WP Dashboard and home page, but not post pages

Postby DigitalDoyle » 06. November 2009 22:45

Just an additional note:
I updated one of my online WP installations to WP v2.8.5 to see if it exhibited any problems, but it seems to be working fine. For some reason the problem seems to affect my localhost xampp installation, but the problem doesn't seem to be in xampp itself; just Wordpress.
DigitalDoyle
 
Posts: 4
Joined: 05. November 2009 16:36

Re: Can access WP Dashboard and home page, but not post pages

Postby Izzy » 06. November 2009 23:22

The new rewrite rule path is the offender as it is assuming that wordpress is in the Apache DocumentRoot, the htdocs folder and not in the wordpress root htdocs\wordpress folder - \index.php which is of course the XAMPP index.php
RewriteRule . /index.php [L]

This is why it works on your online installation as wordpress would be in the web root perhaps and had no need to be changed on update.

Where as in the second rewrite rule, which would have been created when you installed WP, the path is correct \wordpress\index.php
RewriteRule . /wordpress/index.php [L]

The new entry would have been added by the WP update because it could not fine the rewrite rule path \index.php instead it found the path \wordpress\index.php entry which it did not recognize and so replaced it with the expected path.

You did right to delete that section but remember to keep your eye on this the next time you need to update as it is purely an incorrect path issue by the brain dead WP updater.

An alternative would be to delete the XAMPP index.php and index.html in the htdocs folder, then when you want to go to the XAMPP demo pages you would use the URI http://localhost/xampp which may help prevent future confusion for the WP updater.

All is well that ends well.

Good luck.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: Can access WP Dashboard and home page, but not post page

Postby yaronof » 02. December 2010 09:59

Thank you so much for this solution, it finally worked for me, after spending many hours on this problem.
However, I don't understand your last suggestion:
"An alternative would be to delete the XAMPP index.php and index.html in the htdocs folder, then when you want to go to the XAMPP demo pages you would use the URI http://localhost/xampp which may help prevent future confusion for the WP updater."

Can you please clarify? I guess I don't fully understand what confuses the WP updater in the first place, and how would the deletion of these files prevent that from happening? Also, if I understand correctly, only a WP update will cause this to happen again?

In my case, this was the very first time I ever installed XAMPP, followed by the WP installation. Does this mean that every new WP installation will cause the same problem again?

Thank you,
Yaron
yaronof
 
Posts: 3
Joined: 02. December 2010 09:52

Re: Can access WP Dashboard and home page, but not post page

Postby JonB » 02. December 2010 10:08

Did you install WordPress in the root of htdocs???

:roll:
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Can access WP Dashboard and home page, but not post page

Postby yaronof » 02. December 2010 11:00

Hi,
No, I installed WP in a different directory.
When I started this installation, I didn't yet know how to modify the permissions on htdocs folder, so I wasn't able to install it there.
Through the pains of getting through all of this, I now know how to change the permissions.... but in the meantime I created a folder in my "sites" folder for this wp installation.
During this process, one of the mistakes I made (as I was learning about permissions) is that I changed the owner (using 'sudo chown' on terminal) on all of the XAMPP folders and sub files, using the -R option. That caused the mySQL to lock me out, I guess because of a permissions conflict. So I had to delete my WP installation as well as the XAMPP installation and start over again (because I don't know enough to identify the single file whose ownership I shouldn't have changed...). On my second attempt, I changed only the permissions on the path I needed in order to modify a specific file (httpd.conf , to change 'nobody' to my username so that WP would enable plugin updates).

I am running mac os x 10.5

thanks
Y
yaronof
 
Posts: 3
Joined: 02. December 2010 09:52

Re: Can access WP Dashboard and home page, but not post page

Postby JonB » 02. December 2010 13:52

AHHHH -

YOU NEED TO POST THIS ON THE MAC Board

viewforum.php?f=29

:shock:


ytcfi
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Can access WP Dashboard and home page, but not post page

Postby yaronof » 02. December 2010 14:59

Actually, I didn't post a question here, I just added to your solution posted a year ago. I found your solution by searching for the keywords "xampp wordpress home page only", and I'm glad I did, because the solution you gave a year ago, works! even on a mac... I guess this htaccess problem is universally true for xampp.

Nonetheless, thank you for pointing out the mac forum to me.

And thank you once again for providing a detailed, well explained solution that works.

Yaron
yaronof
 
Posts: 3
Joined: 02. December 2010 09:52

Re: Can access WP Dashboard and home page, but not post page

Postby JonB » 02. December 2010 17:42

OK, I see your point -

My #1 concern is that WINDOWS users NOT try to follow your example - as due to differences in the Operating Systems - for XAMPP on Windows - there are NO PERMISSIONS to be tinkered with. :shock:

8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 77 guests