WordPress, "Pretty permalinks" and .htaccess =404

New to mod_rewrite? This is a good place to start.

WordPress, "Pretty permalinks" and .htaccess =404

Postby HollyJahangiri » Mon Jun 01, 2009 5:36 pm

I installed Wordpress 2.7.1 I imported a Blogger blog and comments.

So far, success - everything looks fine. BUT, when I try to change the permalinks to http://jahangiri.us/news/2009/06/sample-post/, and create an .htaccess file in the directory with index.php, containing the following lines (specified by WordPress):

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /news/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /news/index.php [L]
</IfModule>

the posts ONLY show on the front page of the blog. If I click the title or try to add a comment, I get a 404 error. I can still see posts and comments from the Dashboard; clearly, everything's still there.

However, if I remove .htaccess and switch back to "default" permalinks, everything works fine.

Any advice? This is quite frustrating. If it involves doing anything with the database, please use small words and straightforward declarative sentences; my knowledge of databases is...not extensive.

The blog is here: http://jahangiri.us/news
HollyJahangiri
 
Posts: 2
Joined: Mon Jun 01, 2009 5:14 pm

Postby richardk » Tue Jun 02, 2009 10:55 am

Try this mod_rewrite test.

If it works, try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule . /news/index.php [L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

All fixed now...

Postby HollyJahangiri » Tue Jun 02, 2009 11:00 am

It was a combination of having .htaccess in the wrong place (yesterday); then chmod 777 in desperation WORKED, and let WP create it in the right place; then doing that recursively not such a good idea - but a friend went in and fixed it. All good now!
HollyJahangiri
 
Posts: 2
Joined: Mon Jun 01, 2009 5:14 pm

Re: All fixed now...

Postby skyball » Mon Jun 29, 2009 11:44 pm

HollyJahangiri wrote:It was a combination of having .htaccess in the wrong place (yesterday); then chmod 777 in desperation WORKED, and let WP create it in the right place; then doing that recursively not such a good idea - but a friend went in and fixed it. All good now!


I'm having the EXACT same problem. Just set up pretty permalinks for my main site and had zero issues - http://www.jasonnickel.com

Attempted to do the exact same thing on my parents website and nothing is working. I've even edited the .htaccess file maually with the code Wordpress provides and still no luck. Suggestions? Site is http://www.scenicvalleyinn.com ...

I tried the mod rewrite test and got sent to a 404 page. I'm guessing my problem is the same as Holly's - htaccess in the wrong location, but its in the same directory as my other blog's htaccess file, and I havent changed a thing in this latest attempt...

Thanks!
skyball
 
Posts: 2
Joined: Mon Jun 29, 2009 11:41 pm

Postby richardk » Tue Jun 30, 2009 3:04 pm

I tried the mod rewrite test and got sent to a 404 page.

Then it sounds like mod_rewrite isn't available. Ask your host.

I'm guessing my problem is the same as Holly's - htaccess in the wrong location, but its in the same directory as my other blog's htaccess file, and I havent changed a thing in this latest attempt...

The .htaccess file should be at scenicvalleyinn.com/.htaccess. In it try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule . /index.php [L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby skyball » Tue Jun 30, 2009 3:39 pm

I just realized I have all the wordpress files nested one directory below the main. Stuck the .htaccess file up one level and I am now good to go. Thanks for the response.
skyball
 
Posts: 2
Joined: Mon Jun 29, 2009 11:41 pm


Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 80 guests

cron