WordPress SEO Advice

Register 365 Zeus Server Setup for WordPress Permalinks

I ran into an issue today, while optimising a WordPress site hosted on Register 365 Servers, which initially looked to be Apache, but on closer inspection was Zeus. Not to worry I thought, WordPress will sort all this out, it’s an Apache type web server, I am sure the .htaccess will work. Well it did not and after a long time searching and looking around I found this work around.

No .htaccess instead rewrite.script, the code for the rewite.script is below and you can also download a zipped copy of the file here;

>> Download Zeus Server Rewrite Script

Code for rewrite.script

RULE_0_START:
# get the document root
map path into SCRATCH:DOCROOT from /
# initialize our variables
set SCRATCH:ORIG_URL = %{URL}
set SCRATCH:REQUEST_URI = %{URL}

# see if theres any queries in our URL
match URL into $ with ^(.*)\?(.*)$
if matched then
  set SCRATCH:REQUEST_URI = $1
  set SCRATCH:QUERY_STRING = $2
endif
RULE_0_END:

RULE_1_START:
# prepare to search for file, rewrite if its not found
set SCRATCH:REQUEST_FILENAME = %{SCRATCH:DOCROOT}
set SCRATCH:REQUEST_FILENAME . %{SCRATCH:REQUEST_URI}

# check to see if the file requested is an actual file or
# a directory with possibly an index.  don't rewrite if so
look for file at %{SCRATCH:REQUEST_FILENAME}
if not exists then
  look for dir at %{SCRATCH:REQUEST_FILENAME}
  if not exists then
    set URL = /index.php?q=%{SCRATCH:REQUEST_URI}
    goto QSA_RULE_START
  endif
endif

# if we made it here then its a file or dir and no rewrite
goto END
RULE_1_END:

QSA_RULE_START:
# append the query string if there was one originally
# the same as [QSA,L] for apache
match SCRATCH:ORIG_URL into % with \?(.*)$
if matched then
  set URL = %{URL}&%{SCRATCH:QUERY_STRING}
endif
goto END
QSA_RULE_END:

Setting up Pretty Links in WordPress

Upload your new rewite.script to the root of your directory, the root is the top level folder, in the case of this Register 365 Zeus setup it was a folder called web. Login to wordpress, navigate to Settings > Permalinks, check out the image below for configuration setup.

Permalink Settings

If you are having this issue or any other problems with your WordPress sites, drop me a line or use the form at the bottom of the site to submit your site or leave a comment.

8 Comments

  1. Barry
    July 11, 2011 at 12:39 pm

    Do you know if this works with other servers like Windows servers or is this a Zeus specific fix?

    Reply
    • Niall Flynn
      July 12, 2011 at 10:31 am

      I have had similar problems with IIS, this is a Zeus specific fix, personally when I get this sort of messing going on I switch host. That was my advice to the client this time as the lack of mod rewrite was only the tip of the ice berg.

      What site are you trying this on?

      Reply
  2. Terry Kendrick
    August 25, 2011 at 8:59 pm

    Hi – Thanks for this script works on the main site but then mess up the admin access to the website? Any ideas

    Regards Terry

    Reply
    • Niall Flynn
      August 25, 2011 at 9:36 pm

      Not sure about the admin, feel free to email me hello@niallflynn.ie I normally recommend ppl to switch host in cases like this, google spiral hosting they are by far the best Irish host.

      Reply
  3. Gareth
    October 28, 2011 at 4:46 pm

    Hi, Using WP 3.2.1 and can’t use pretty links: /%category%/%postname%/, even with the script. Any ideas? Getting the 404 not found error.

    Reply
    • Niall Flynn
      October 28, 2011 at 4:58 pm

      I would need to see the exact ftp and wp setup, as I said before I would just switch host, these sorts of errors are usually just the tip of the iceberg ๐Ÿ™‚ drop me a mail at hello@niallflynn.ie I will do what I can to help.

      Reply
    • Gareth
      October 28, 2011 at 5:08 pm

      It’s fine I fixed it. Had the site in a sub-directory so had to change the path in the script.

      Reply
      • Niall Flynn
        October 28, 2011 at 5:09 pm

        Glad it helped ๐Ÿ™‚

        Reply

Leave a comment