mod_rewrite on godaddy with wordpress

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

mod_rewrite on godaddy with wordpress

.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

<br />
Options SymlinksIfOwnerMatch</p>
<p>RewriteEngine On<br />

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
<br />
/archives/%year%/%monthnum%/%day%/%postname%/<br />

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.

Posted by Rob on Sat, 02/19/2005 - 02:45
mod_rewrite on godaddy with wordpress

I tried your suggestion, but it did not work. So I e-mailed godaddy.com. Here is their response:

Quote:
Thank you for contacting customer support.

Mod_rewrite is enabled on our servers. Unfortunately it will not work with our current configuration of PHP.

What kind of answer is that?

Posted by Jason on Sat, 02/19/2005 - 17:58
mod_rewrite on godaddy with wordpress

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:

<br />
Options SymlinksIfOwnerMatch<br />
RewriteEngine On</p>
<p>RewriteRule ^left$ /test/right.html

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.

Posted by Rob on Sat, 02/19/2005 - 22:39
mod_rewrite on godaddy with wordpress

Wow! Ok, that actually did work!
Now I can do some more testing to see why Wordpress isn't working...

Thanks.

Posted by Jason on Sat, 02/19/2005 - 23:24
mod_rewrite on godaddy with wordpress

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.

Posted by Jason on Sun, 02/20/2005 - 01:08
mod_rewrite on godaddy with wordpress

Sounds great, happy blogging :)

Posted by Rob on Sun, 02/20/2005 - 04:32
Final Followup

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

Posted by Jason on Wed, 06/01/2005 - 12:50