Register 365 Permalinks

July 6, 2011
Posted in News
July 6, 2011 Niall Flynn

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.

Comments (8)

  1. Barry

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

    • Niall Flynn

      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?

    • Niall Flynn

      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.

  2. Gareth

    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.

    • Niall Flynn

      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.

    • Gareth

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

Leave a Reply

Your email address will not be published. Required fields are marked *

* Checkbox GDPR is required

*

I agree