Archive for ‘wordpress’ Category
Browse:
wordpress »
Subcategories:

After reading many (too many) posts about this subject that did not work, I finally found a way to get this working. If you have a wordpress site setup you will, at some point during the installation, be told to copy a bunch of “redirect” code to your .htaccess file in your wordpress installation folder. These apache redirects take care of making pretty URL’s and permalinks amongst other things. The problem is that these .htaccess rules in wordpress take over server-info and server-status urls activated in apache’s config and return a page not found error.

I came across numerous sites that suggested adding a rule like:

RewriteCond %{REQUEST_URI} !=/server-status

This didn’t work for me. I’m not sure if the multisite version of wordpress (which I’m using) is causing this. The rule that worked beautifully is the following:

RewriteRule ^(server-info|server-status) - [L]

This rule stops the rewrite engine whenever server-info or server-status is parsed as part of the URL. So my .htaccess looks like this now:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Stop Processing if you see server-info or server-status
RewriteRule ^(server-info|server-status) - [L]
# The Rewrite Condition below did not work
# RewriteCond %{REQUEST_URI} !=/server-status
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . index.php [L]
</IfModule>
# END WordPress

Quotes and such in WordPress…..

datePosted on 15:30, September 20th, 2010 by Many Ayromlou

As nice as wordpress is, it can sometimes turn your life into a bit of a nightmare. Case in point the title in my previous post. I was trying to tell WP that I want straight double quotes (ie: “) and it kept insisting on beautifying it and turning it into curly double quotes. These curly quotes have a different meaning in Unix, so if you’re using a “cut-and-paste” unix command in your post title you’re kinda out of luck. There is a process called wptexturize that turns simple everyday quotes/doublequotes into what they call smart quotes. Anyways, to work around this you can use the following tables HTML names instead of the actual character when you’re writing your post:

Symbol HTML Name HTML Number Description
&quot; &#34; Double Quote
&#39; Single Quote
&lsquo; &#8216; Left Single Quote
&rsquo; &#8217; Right Single Quote
&ldquo; &#8220; Left Double Quote
&rdquo; &#8221; Right Double Quote

WordPress import plugin for blogger fix….

datePosted on 10:21, August 16th, 2010 by Many Ayromlou

Version 0.2 of the blogger plugin for wordpress 3.x has a small little bug in it that produces the following error:

Something went wrong. If the problem persists, send this info to support:

HTTP/1.0 403 Invalid AuthSub token.
Content-Type: text/html; charset=UTF-8
Content-Length: 167
Date: Fri, 06 Aug 2010 20:16:35 GMT
Expires: Fri, 06 Aug 2010 20:16:35 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block

Server: GSE

<HTML>
<HEAD>
<TITLE>Invalid AuthSub token.</TITLE>
</HEAD>
<BODY BGCOLOR=”#FFFFFF” TEXT=”#000000″>
<H1>Invalid AuthSub token.</H1>

<H2>Error 403</H2>
</BODY>
</HTML>

I’ve been banging my head against the wall trying to figure out what’s wrong with their code and I think I’ve found a fix (atleast until version 0.3 of the plugin comes out at which time this fix will not apply anymore…..hopefully).

The problem is with the regex code in the auth() function of the blogger-importer.php plugin. So edit this file and make the following changes:

1) Line 99:OLD: $token = preg_replace( '/[^-_0-9a-zA-Z]/', '', $_GET['token'] );
NEW: $token = preg_replace( '/[^%-_0-9a-zA-Z]/', '', $_GET['token'] );
Note: % sign added in the regex portion.

2) Line 108:OLD: preg_match( '/token=([-_0-9a-z]+)/i', $response, $matches );
NEW: preg_match( '/token=([%-_0-9a-z]+)/i', $response, $matches );
Note: % sign added in the regex portion.

Hopefully this will help you get going…..