Wordpress 3 and Dreamhost Stats

apps

#1

Hi all.

I’ve got Wordpress 3 setup on my domain and is all working quite happily except I can’t access the Dreamhost /stats directory. I’ve input the .htaccess code in the wiki and now get the login box for the directory, but once I log in all I get is a 404 error.

Any ideas? .htaccess contents below:

[code]
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/(stats|failed_auth.html).*$ [NC]
RewriteRule . - [L]

BEGIN WordPress

RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]

END WordPress

[/code]


#2

What are the three, or at least one of, the domains?


#3

That sure looks right. How did you edit the .htaccess file?


#4

There’s only one domain which Wordpress 3.0.1 is running on and that’s www.ijeffers.com

The .htaccess was created by Wordpress and then I editted using Notepad and uploaded again.

Also created a fresh one from scratch using Textpad and get the same result.


#5

http://www.ijeffers.com/stats/ works for me! Have you thoroughly cleared your cache?


#6

Yup, cleared the cache and tried different browsers on different computers to make sure it wasn’t anything stored on the computer.

I get the stats login box, but when putting inn my username/password (which I have double checked works on both the panel and other sub-domains) just get redirected to a wordpress 404 error. :confused:


#7

Notepad isn’t good for editing server files. Textpad should do it, though. There’s also the built-in text editor in the DH panel’s WebFTP, which would be my first choice over Notepad or Textpad. I still think it’s a file format issue.

If you have command line access and can log in with PuTTY or the like, you can try the dos2unix command to clean up the format:
/usr/bin/dos2unix ~/USER/ijeffers.com/.htaccess


#8

Ah-ha!

Ran the command you gave and it still didn’t work. So logged on using putty and renamed the file and created a brand new .htaccess with exactly the same lines (copy/paste job) and it’s now bringing it up!

Cheers all. :slight_smile:


#9

I think this is the clue. Note that stats users are not the default password for status users. Now add to this the fact that it you enter the wrong user/password, the authentication routine will try to load a failure page, and since that is blocked by the .htaccess re-write rules, you will end up with a WordPress generated 404 instead of a password failure notice.

Try going to the panel, into the “Site States” section, and edit/change that stats user password. Then, save the change, and wait till it takes effect (the clock icon is gone for that user).

Then, clear your caches and try it again; this may well be the issue.


#10

Thanks rlparker

For whatever reason recreating the .htaccess using vi on putty has kicked everything into action, not sure what hidden characters were in the file that were stopping it working.

All sorted now. :slight_smile:

Thanks again.


#11

Good deal! Scott had it right! :wink: I am glad you got it working!


#12

Just for understanding what it was, you might want to run both the working and non-working files through the od command in the shell. “od -a .htaccess” or “od -b .htaccess” can be revealing. A little more so than just a diff, unless there are some diff options I don’t know about.


#13

Well ran the commands and can’t see any obvious differences between them:

Working:

0000000   <   I   f   M   o   d   u   l   e  sp   m   o   d   _   r   e
0000020   w   r   i   t   e   .   c   >  nl   R   e   w   r   i   t   e
0000040   E   n   g   i   n   e  sp   O   n  nl   R   e   w   r   i   t
0000060   e   B   a   s   e  sp   /  nl   R   e   w   r   i   t   e   C
0000100   o   n   d  sp   %   {   R   E   Q   U   E   S   T   _   U   R
0000120   I   }  sp   ^   /   (   s   t   a   t   s   |   f   a   i   l
0000140   e   d   _   a   u   t   h   \   .   h   t   m   l   )   .   *
0000160   $  sp   [   N   C   ]  nl   R   e   w   r   i   t   e   R   u
0000200   l   e  sp   .  sp   -  sp   [   L   ]  nl   <   /   I   f   M
0000220   o   d   u   l   e   >  nl  nl   #  sp   B   E   G   I   N  sp
0000240   W   o   r   d   P   r   e   s   s  nl   <   I   f   M   o   d
0000260   u   l   e  sp   m   o   d   _   r   e   w   r   i   t   e   .
0000300   c   >  nl   R   e   w   r   i   t   e   E   n   g   i   n   e
0000320  sp   O   n  nl   R   e   w   r   i   t   e   B   a   s   e  sp
0000340   /  nl   R   e   w   r   i   t   e   R   u   l   e  sp   ^   i
0000360   n   d   e   x   \   .   p   h   p   $  sp   -  sp   [   L   ]
0000400  nl   R   e   w   r   i   t   e   C   o   n   d  sp   %   {   R
0000420   E   Q   U   E   S   T   _   F   I   L   E   N   A   M   E   }
0000440  sp   !   -   f  nl   R   e   w   r   i   t   e   C   o   n   d
0000460  sp   %   {   R   E   Q   U   E   S   T   _   F   I   L   E   N
0000500   A   M   E   }  sp   !   -   d  nl   R   e   w   r   i   t   e
0000520   R   u   l   e  sp   .  sp   /   i   n   d   e   x   .   p   h
0000540   p  sp   [   L   ]  nl   <   /   I   f   M   o   d   u   l   e
0000560   >  nl  nl   #  sp   E   N   D  sp   W   o   r   d   P   r   e
0000600   s   s  nl  nl
0000604

Not Working:

0000000   <   I   f   M   o   d   u   l   e  sp   m   o   d   _   r   e
0000020   w   r   i   t   e   .   c   >  nl   R   e   w   r   i   t   e
0000040   E   n   g   i   n   e  sp   O   n  nl   R   e   w   r   i   t
0000060   e   B   a   s   e  sp   /  nl   R   e   w   r   i   t   e   C
0000100   o   n   d  sp   %   {   R   E   Q   U   E   S   T   _   U   R
0000120   I   }  sp   ^   /   (   s   t   a   t   s   |   f   a   i   l
0000140   e   d   _   a   u   t   h   \   .   h   t   m   l   )   .   *
0000160   $  sp   [   N   C   ]  nl   R   e   w   r   i   t   e   R   u
0000200   l   e  sp   .  sp   -  sp   [   L   ]  nl   <   /   I   f   M
0000220   o   d   u   l   e   >  sp  nl  nl   #  sp   B   E   G   I   N
0000240  sp   W   o   r   d   P   r   e   s   s  nl   <   I   f   M   o
0000260   d   u   l   e  sp   m   o   d   _   r   e   w   r   i   t   e
0000300   .   c   >  nl   R   e   w   r   i   t   e   E   n   g   i   n
0000320   e  sp   O   n  nl   R   e   w   r   i   t   e   B   a   s   e
0000340  sp   /  nl   R   e   w   r   i   t   e   R   u   l   e  sp   ^
0000360   i   n   d   e   x   \   .   p   h   p   $  sp   -  sp   [   L
0000400   ]  nl   R   e   w   r   i   t   e   C   o   n   d  sp   %   {
0000420   R   E   Q   U   E   S   T   _   F   I   L   E   N   A   M   E
0000440   }  sp   !   -   f  nl   R   e   w   r   i   t   e   C   o   n
0000460   d  sp   %   {   R   E   Q   U   E   S   T   _   F   I   L   E
0000500   N   A   M   E   }  sp   !   -   d  nl   R   e   w   r   i   t
0000520   e   R   u   l   e  sp   .  sp   /   i   n   d   e   x   .   p
0000540   h   p  sp   [   L   ]  nl   <   /   I   f   M   o   d   u   l
0000560   e   >  nl  nl   #  sp   E   N   D  sp   W   o   r   d   P   r
0000600   e   s   s  nl
0000604

Working:

0000000 074 111 146 115 157 144 165 154 145 040 155 157 144 137 162 145 0000020 167 162 151 164 145 056 143 076 012 122 145 167 162 151 164 145 0000040 105 156 147 151 156 145 040 117 156 012 122 145 167 162 151 164 0000060 145 102 141 163 145 040 057 012 122 145 167 162 151 164 145 103 0000100 157 156 144 040 045 173 122 105 121 125 105 123 124 137 125 122 0000120 111 175 040 136 057 050 163 164 141 164 163 174 146 141 151 154 0000140 145 144 137 141 165 164 150 134 056 150 164 155 154 051 056 052 0000160 044 040 133 116 103 135 012 122 145 167 162 151 164 145 122 165 0000200 154 145 040 056 040 055 040 133 114 135 012 074 057 111 146 115 0000220 157 144 165 154 145 076 012 012 043 040 102 105 107 111 116 040 0000240 127 157 162 144 120 162 145 163 163 012 074 111 146 115 157 144 0000260 165 154 145 040 155 157 144 137 162 145 167 162 151 164 145 056 0000300 143 076 012 122 145 167 162 151 164 145 105 156 147 151 156 145 0000320 040 117 156 012 122 145 167 162 151 164 145 102 141 163 145 040 0000340 057 012 122 145 167 162 151 164 145 122 165 154 145 040 136 151 0000360 156 144 145 170 134 056 160 150 160 044 040 055 040 133 114 135 0000400 012 122 145 167 162 151 164 145 103 157 156 144 040 045 173 122 0000420 105 121 125 105 123 124 137 106 111 114 105 116 101 115 105 175 0000440 040 041 055 146 012 122 145 167 162 151 164 145 103 157 156 144 0000460 040 045 173 122 105 121 125 105 123 124 137 106 111 114 105 116 0000500 101 115 105 175 040 041 055 144 012 122 145 167 162 151 164 145 0000520 122 165 154 145 040 056 040 057 151 156 144 145 170 056 160 150 0000540 160 040 133 114 135 012 074 057 111 146 115 157 144 165 154 145 0000560 076 012 012 043 040 105 116 104 040 127 157 162 144 120 162 145 0000600 163 163 012 012 0000604

Not Working:

0000000 074 111 146 115 157 144 165 154 145 040 155 157 144 137 162 145 0000020 167 162 151 164 145 056 143 076 012 122 145 167 162 151 164 145 0000040 105 156 147 151 156 145 040 117 156 012 122 145 167 162 151 164 0000060 145 102 141 163 145 040 057 012 122 145 167 162 151 164 145 103 0000100 157 156 144 040 045 173 122 105 121 125 105 123 124 137 125 122 0000120 111 175 040 136 057 050 163 164 141 164 163 174 146 141 151 154 0000140 145 144 137 141 165 164 150 134 056 150 164 155 154 051 056 052 0000160 044 040 133 116 103 135 012 122 145 167 162 151 164 145 122 165 0000200 154 145 040 056 040 055 040 133 114 135 012 074 057 111 146 115 0000220 157 144 165 154 145 076 040 012 012 043 040 102 105 107 111 116 0000240 040 127 157 162 144 120 162 145 163 163 012 074 111 146 115 157 0000260 144 165 154 145 040 155 157 144 137 162 145 167 162 151 164 145 0000300 056 143 076 012 122 145 167 162 151 164 145 105 156 147 151 156 0000320 145 040 117 156 012 122 145 167 162 151 164 145 102 141 163 145 0000340 040 057 012 122 145 167 162 151 164 145 122 165 154 145 040 136 0000360 151 156 144 145 170 134 056 160 150 160 044 040 055 040 133 114 0000400 135 012 122 145 167 162 151 164 145 103 157 156 144 040 045 173 0000420 122 105 121 125 105 123 124 137 106 111 114 105 116 101 115 105 0000440 175 040 041 055 146 012 122 145 167 162 151 164 145 103 157 156 0000460 144 040 045 173 122 105 121 125 105 123 124 137 106 111 114 105 0000500 116 101 115 105 175 040 041 055 144 012 122 145 167 162 151 164 0000520 145 122 165 154 145 040 056 040 057 151 156 144 145 170 056 160 0000540 150 160 040 133 114 135 012 074 057 111 146 115 157 144 165 154 0000560 145 076 012 012 043 040 105 116 104 040 127 157 162 144 120 162 0000600 145 163 163 012 0000604

Might make more sense to you then me rukidding :slight_smile:


#14

How 'bout that. There are some extra spaces at the end of some lines.
Line 0000220 in the first bad example has a space (sp) after the end of the /IfModule line closing out the /stats section. It would seem that it (the space) messes up that section of .htaccess.

If you still have the bad .htaccess, use vi and, line by line, hit the $ to jump to the end of the line, you’ll see a space for the last character.


#15

… all that for a space!

Will make a note of that shortcut in vi in case I have problems with any other .htaccess files in the future!