Forum Moderators: phranque

Message Too Old, No Replies

Changing Mod_Rewrite Rule.?

A problem in WordPress Permalinks

         

webgaya

1:40 pm on Jul 28, 2007 (gmt 0)

10+ Year Member



My WP files are in a folder called 'blog' under the root directory and I have pointed blog address to my site home page. My settings are like below,

WordPress address (URI): http://www.example.com/blog

Blog address (URI): http://www.example.com

Recently I installed PHPList in a sub directory. It's address is as below,

http://www.example.com/lists/newsletter/

The problem I have is, WP shows its 404 error page for some URLs in folder 'newsletter'. I suspect this is due to the ReWrite rule WP has employed. In root directory .htaccess, the rules are as below,

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

# END WordPress

How can I avoid 'lists' folder from above rules. I found a post about using 'RewriteCond' to do this,

[webmasterworld.com...]

But I was unable to get it done yet.
Can anyone please tell me exact steps to follow
and exact code to paste?

jdMorgan

7:43 pm on Jul 28, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can exclude the /lists subdirectory from your WP rewrite by adding a RewriteCond (condition) to the WP rule. This recent thread [webmasterworld.com] describes how to do it.

Jim

webgaya

8:37 am on Jul 29, 2007 (gmt 0)

10+ Year Member



Hi Jim,

I added the rule, now whole thing is as below,

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog
RewriteCond %{REQUEST_URI}!^/lists
RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule . /blog/index.php [L]
</IfModule>

# END WordPress

But still WP 404 error page is shown for some urls
under lists folder?

g1smd

5:43 pm on Jul 29, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Add a new .htaccess file in that folder; one that declares a different error page filename for 404 errors.

Are you sure that it is 404 errors that are triggering it, and not some other 40x error cascading to a "404 not found" for that other error simply having a missing error page for itself?

jdMorgan

3:23 am on Jul 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Flush your browser cache completely before testing any change to .htaccess.

JIm