mod_rewrite on godaddy with wordpress
Posted by Jason on Sat, 02/19/2005 - 00:42 in
I've got the Wordpress blogging software up on my hosting service (godaddy.com) However, I would like to be able to the "permalink" feature, but I cannot figure out how to get mod_rewrite to work.
So far, I've tried putting up a .htaccess file on the root of my server that contains only:
RewriteEngine on
But, this still does not work. I get a 404 error.
Wordpress is installed in a subdirectory "main"
Any advice? Thanks
.htaccess affects the directory that it's in and any subdirectories. I think that mod_rewrite will be simpler with .htaccess in the /main/ directory. Actually, WordPress will give you the mod_rewrite rules and it will probably look there for it.
in /main/.htaccess, try
Then log in to WordPress as admin and look at the "Options" tab. Under that choose "Permalinks." There's an explanation of how to edit the layout of links and an edit box to enter your formatting string in. I use
for my WordPress blog.
Hit the "Update Permalink Structure" button and you should get a set of rules underneath for your .htaccess. Copy and paste them in to .htaccess under "RewriteEngine On" and you should be all set.
I tried your suggestion, but it did not work. So I e-mailed godaddy.com. Here is their response:
What kind of answer is that?
Bizarre. mod_rewrite is totally independent of PHP. Try a test in another directory with mod_rewrite. Just give it a simple rule to rewrite one file name to another.
Something like this:
requires no PHP.
Create a directory off the root of the site called test, put this .htaccess in it and put a file called right.html in that folder. When you browse to http://www.example.com/left , you should see the contents of right.html.
Wow! Ok, that actually did work!
Now I can do some more testing to see why Wordpress isn't working...
Thanks.
Everything is working fine now.
There was another factor that I didn't realize.
For my permalink structure in Wordpress I was trying to use:
/%year%/%monthnum%/%category%/%post_id%However, I've discovered that the %category% tag does not work. As soon as I remove it, I have no problems.
Sounds great, happy blogging :)
Just thought I would post a followup on this issue.
After getting mod_rewrite and Wordpress to work I discovered that with godaddy you cannot mod_rewrite any files with a .php extension. (You can rewrite TO a .php file but not FROM) Apparently this is "unsupported" (read: we don't want to bother fixing the problem)
So, I have switched to another hosting provider: 1and1.com. So far, they seem to be really good. I haven't had to deal with their tech support yet, but that's because everything just works as it should!
-- Jason
yorkspace.com