WordPress.org

Ready to get started?Download WordPress

Forums

.htaccess redirect from root to subdirectory (1 post)

  1. johndove523
    Member
    Posted 2 years ago #

    My website is currently re-directing from http://caspca.org to http://caspca.org/wordpress/ via a simple index.html .js re-direct. This is exactly what I want it to do, but I would prefer to do this the right way, via the .htaccess file, but I've been unsuccessful so far.

    Following these instructions:
    http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory#Pointing_your_home_site.27s_URL_to_a_subdirectory

    I changed my original .htaccess file from this:

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

    to this (in Step 3 of instructions it says "add", not "replace", so that's what I did):

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^(www.)?caspca.org$
    RewriteRule ^(/)?$ caspca.org/wordpress/blog [L]
    RewriteBase /wordpress/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /wordpress/index.php [L]
    </IfModule>

    and uploaded it to the root per the instructions. The .htaccess file is the ONLY wordpress file in the root (it didn't say anything about having an index.php, etc.)

    Can anyone tell me how to code the .htaccess file correctly to redirect from caspca.org to caspca.org/wordpress/ ?

    Thank you,

    John

Topic Closed

This topic has been closed to new replies.

About this Topic