WordPress.org

Ready to get started?Download WordPress

Forums

Limit Rewrite to WordPress Directory Only (4 posts)

  1. vinhboy
    Member
    Posted 5 years ago #

    I installed wordpress into the /wordpress directory on my site. How do I contain rewriting only to the wordpress directory. For example:

    Ok, rewrite:
    http://example/wordpress/anything-query

    SHOULD NOT rewrite:
    http://example.com/anything-query

    The .htaccess inside the /wordpress directory is:

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

    Thank you in advance.

  2. moshu
    Member
    Posted 5 years ago #

    Do you have a 404.php file in your theme? That's what WP is using for non-existing pages; otherwise will take you to the main index...

  3. vinhboy
    Member
    Posted 5 years ago #

    Sorry, I need to clarify.

    I am not worried about the 404 msg. I am worried that wordpress rewrite rules are applied server-wide, and not just constrained to the /wordpress directory

    I tried changing the rewrite rule to

    RewriteRule ^/wordpress/.*$ /wordpress/index.php [L]

    Also tried

    RewriteRule ^/wordpress/(.*)$ /wordpress/index.php [L]

    And finally,

    RewriteRule ^(.*)/wordpress/(.*)$ /wordpress/index.php [L]

    But none of them worked.

  4. iridiax
    Member
    Posted 5 years ago #

    I installed wordpress into the /wordpress directory on my site. How do I contain rewriting only to the wordpress directory.

    It already is unless you have done this:

    http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

Topic Closed

This topic has been closed to new replies.

About this Topic