WordPress custom permalinks not working – Zeus Web Server
If you’re having troubles with your custom permalinks within WordPress, I feel your pain, and am here to help.
Most hints and tips point to editing your mod_rewrite module & .htaccess file, which is great providing you’re WordPress Blog is installed on an Apache server.
If your attempts at editing or adding an .htaccess file have failed, there’s a good chance you’re installed on a Zeus server, in which case you will need to use rewrite.script instead.
Create a new/edit a current rewrite.script file to include the following code, and upload it to the root directory of your blog (Not forgetting to back up a previous version first).
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:
Once uploaded, you will need to navigate to the permalinks settings, within your WordPress admin section, check the custom permalinks option and enter your custom permalink code. I would recommend:
/%category%/%postname%/
Save changes and away you go.
*Note* Even if custom permalinks is already checked, once you upload your rewrite.script file, you will need to click ‘Save Changes’ again.

HEY WARREN!!
Excuse me for shouting, but sir, you have (not) literally SAVED MY LIFE! Well, it sure feel like that.
I have a WP blog (bookbee.com.au) that I’ve been trying to implement buddypress on without luck for – oh, I don’t know – SIX MONTHS! I started trying it with WordPress, but had to drop the BP experiment after a while – Buddypress installed (plug-in) OK, but I was faced with 404 errors on every BP page.
I’m no php expert or server jockey, so I was floundering. First, I thought it was that my magazine-like theme wasn’t compatible with BP. No.
Did the upgrade to WP3.0 RC2 recently, and started to try again – did the “BP template pack” install to convert my theme to a Bp them. No dice.
Then I REALISED I’M ON A ZEUS server and my mod-rewrite wasn’t happening.
More angst, until I happened upon this gem:
“#Zeus webserver version of basic WordPress mod_rewrite rules
map path into SCRATCH:path from %{URL}
look for file at %{SCRATCH:path}
if exists then goto END
look for dir at %{SCRATCH:path}
if exists then goto END
##### FIX FOR LOGIN/FORGOTTEN PASSWORD/ADMIN ETC #####
match URL into $ with ^/wp-.*$
if matched then goto END
set URL = /index.php”
- Your Zeus rewrite code/script/magic! Pasted it into a little box provided by my web host and BAM! Success! It just worked.
Quite simply, you have made my world seem like a happier place today. Thank you VERY much.
Generous sharing of skills like yours are what make the web great.
J
Jason,
It sounds like you’ve been on quite a roller coaster with your site, and I’m genuinely pleased I could help you out.
And, on top of that I couldn’t have wished for a better first comment on my blog – I appreciate you taking the time.
bookbee.com.au looks awesome by the way – bookmarked
Thanks
Warren
I have one website hosted on a zeus server too, and although permalinks do work, I want to get rid of this irritating “index.php” from url. Is this possible too?
Thanks for your help
Hi Mark,
Is this happening on all pages/posts/archives etc, or just certain ones – do you have a link to your site
Thanks
Warren
LOL I saw ‘set URL = /index.php’ in your code and thought it won’t fix it, so did not even try using it. It happens to work perfectly, thanks for your help!
No worries Mark, glad it’s all sorted and the code worked.
And now for a very dumb question….
Where would i find my rewrite.script file? can i make one up myself? is it a .txt file?
Hey Sam,
You can make one yourself, open a new notepad/wordpad document, paste the code and save it with the name rewrite.script – then upload the file to the root of your domain
Any problems, give me a rah!!
Excellent bit of code – just discovered a new client was working with a Zeus server and my heart sank after previous experience! But this worked first time – thanks!
Keep up the good work
That’s good to know Keith, thanks for the message
hi all, im havin the omnipresent problem with WPMU/Buddypress/Zeus installation at in2amsterdam.com
ive deleted my htaccess file and uploaded a rewrite.script with the code from the top of this page but my permalink settings are still putting the index.php before my links thus throwing my buddypress links out.
Where am i goin wrong?
Hi Clarke,
I am working on a solution for WPMU, with a colleague. One of my hosting companies have said it won’t work on a Zeus server, however I’m too stubborn to accept that.
Things are crazy right now, so it may be a week or two until I post something WPMU related, but try back.
Warren
Hi Warren,
Thanks for sharing this info.
Would this work on a subdomain ‘acting’ as a subdirectory?
I’ve got my main domain pointing out to another host and want to host my blog on blog.folkeandersen.com (or http://www.folkeandersen.com/blog/) and it didn’t seem to work for me.
I’ve already got one re-write rule (not as a script) loaded directly via my console which is there to make the subdomain work as a subdirectory. Can I have two re-write rules work without conflict?
Zeus seems to be a bit of a headache when it comes to permalinks and WordPress?
Any input would be appreciated…
Thanks,
Thomas
Hi Thomas,
Apologies for the huge delay in getting back to you.
This isn’t something I’ve tried, although I don’t imagine this rewrite.script file should cause any problems to that.
You should be able to upload the rewrite.script file to the root of the directory, and test. If it has any adverse affect, just remove the file again and it wont affect anything.
Any doubt, have a word with your host before you do anything