WordPress.org

Ready to get started?Download WordPress

Forums

Changing Permalink ReWriting Rule.....? (7 posts)

  1. webgaya
    Member
    Posted 6 years ago #

    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

    In the 'blog' folder .htaccess, rules are like below. I think WP no longer uses these rules and it only uses the ones contain in root directory.

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

    # END WordPress

    What I want to know is that, is there a way to exclude 'newsletter' folder from above rule? Or, is there any other way that I can overcome this issue?

  2. moshu
    Member
    Posted 6 years ago #

    The instructions here:
    http://codex.wordpress.org/Giving_WordPress_its_own_Directory
    say clearly: COPY your htaccess from the WP folder to the root. It doesn't say: change it :)

  3. webgaya
    Member
    Posted 6 years ago #

    Hi, thanks for your attention.

    I had already moved index.php to the root folder and changed
    require('./wp-blog-header.php'); to
    require('./blog/wp-blog-header.php');

    As you said, since stuff in 'blog .htaccess' should be copied to 'root .htaccess', I did so. Now root .htaccess includes rules as below,

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

    # END WordPress

    But still the problem remains.........

    Is there anything else I can do?

  4. moshu
    Member
    Posted 6 years ago #

    I had already moved index.php to the root folder
    If you meant what you wrote - that's wrong again. You do NOT move. You copy! Meaning you have the short and sweet index in both places - in the WP folder unchanged and at the root with the modification you showed above.

  5. seanwhe
    Member
    Posted 5 years ago #

    I'm having the same type of problem.

    WP installed in public_html/
    PHPList is in public_html/lists/

    To install phplist I need to run http://www.mysite.com/lists/admin

    This brings the 404 error from WP

    public_html/.htacess contains

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

    # END WordPress

    So I tried a number of things to try stop it.

    including

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} -d [OR]
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule .* - [L]

    Still cant run install scripts on any other directories that are not WP.

    Any ideas?

  6. seanwhe
    Member
    Posted 5 years ago #

    OK, a bit more investigation brought me to find that the lists/.htacess contains php_flag magic_quotes_gpc on

    Removing this while the WP public_html/.htacess is as follows, solved the problem.

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteRule ^lists/.* - [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

  7. msmeritt
    Member
    Posted 5 years ago #

    Another thread mentioned that this didn't work. I had a related problem, and I found a solution that did work for it. Try this:

    http://wordpress.org/support/topic/179014?replies=2

    FYI, may want to take note of the comment I just added myself about this solution:

    http://www.andrewrollins.com/2008/01/22/wordpress-and-htaccess-password-protected-directories/#comment-386

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags