Forums

RewriteCond?! Can WP leave "invisible" directories alone (4 posts)

  1. andy-with-love
    Member
    Posted 1 year ago #

    I Have two subversionproject which is linked to my domain which is accessible via 
mydomain.com/project1
 and mydomain.com/project2 (these are not "pshycial" directories, I cant see them in my ftp-client)

    Now that I have installed WordPress, I can not access these pages, I come to the WordPress 404 page.

    So, my question is... In WordPress can I specify the directories mydomain.com/project1 and mydomain.com/project2 so wordpress should leave these directories alone?

    I figure it´s in the .htaccess file i should write something but what?

    I got some code from a guy but tat didnt work

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    RewriteCond %{REQUEST_URI} !^/project1
    RewriteCond %{REQUEST_URI} !^/project2
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
  2. flamenco
    Member
    Posted 1 year ago #

    Oh yeah,
    I've run into this a few times. You install WP, and suddenly some sites or pages don't work, and at first, whoa, I have no idea? :)

    I think the syntax may be pretty server-sensitive. This is like what I used to get it to work. Note the slight difference at the end:

    RewriteCond %{REQUEST_URI} !^/project1.*$
    RewriteCond %{REQUEST_URI} !^/project2.*$

    And you would leave the other lines intact. If that doesn't work, it's above my pay grade, and a .htaccess guru may be needed. :)

    Dave

  3. andy-with-love
    Member
    Posted 1 year ago #

    Dave,
    Gaaaah it doesn't work!
    I change the .htaccess file and I change my permalinks settings to "Month and name"

    Heres what's inside the .htaccess

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    RewriteCond %{REQUEST_URI} !^/project1.*$
    RewriteCond %{REQUEST_URI} !^/project2.*$
    RewriteCond %{REQUEST_URI} !^/project3.*$
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    Then I go back and check the .htaccess file again
    And only this remains:

    # BEGIN WordPress
    
    # END WordPress

    Wierd as hell! what im a doing wrong?!

  4. andy-with-love
    Member
    Posted 1 year ago #

    I solved that problem:
    I read somewhere that i should put my own rewrite rules outside of the #BEGIN and #END lines.
    that worked!

    but my main problem still remain :(

Topic Closed

This topic has been closed to new replies.

About this Topic