• Resolved webbeetle

    (@webbeetle)


    Howdy!

    I guess this needs a rather long introduction: I have an existing site, dare2go.com, and I’m in the process of setting up WordPress. I’ve followed pretty much the steps in http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory#Using_a_pre-existing_subdirectory_install, so the WordPress install now resides in a sub-directory called “/travel” (that’s the topic of our site).
    Now I want to move index.php into the root directory! (No problem with that).
    But the existing site (who’s index is called main.shtml) shall remain up with all sub-pages and directories, as it gets a lot of incoming links (and good SERP results for some terms) – it will be also linked from the new WP-site through a menu link “2006-2009”.

    The general technicality of switching from the old site (and keep it in the background) to the new site should be solved by the first line in my htaccess
    DirectoryIndex main.shtml index.php index.html
    by moving index.php to the front of all three. Am I correct?

    Where I’m stuck (I confess: mostly because I don’t understand them very well) are the re-write rules which follow in the WordPress htaccess file, which I believe I need to attach to my existing htaccess… [normally you’re supposed to move the WP htaccess into the root directory, which I can’t do]. How will these rewrite rules affect load order, etc. The current htaccess from WP:

    # BEGIN W3TC Browser Cache
    <IfModule mod_deflate.c>
        <IfModule mod_headers.c>
            Header append Vary User-Agent env=!dont-vary
        </IfModule>
            AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
        <IfModule mod_mime.c>
            # DEFLATE by extension
            AddOutputFilter DEFLATE js css htm html xml
        </IfModule>
    </IfModule>
    # END W3TC Browser Cache
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /travel/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /travel/index.php [L]
    </IfModule>
    
    # END WordPress

    Can I simply attach this to my existing htaccess file without messing anything up?
    Mine reads currently as follows:

    DirectoryIndex main.shtml index.php index.html
    ErrorDocument 403 http://www.dare2go.com/main.shtml
    ErrorDocument 404 http://www.dare2go.com/missing.shtml
    IndexIgnore *
    RewriteEngine on
    # hot linking protection
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?dare2go.com.*$ [NC]
    RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ nohotimg.shtml [R,NC]
    RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [OR]
    # long list to block bots, in there since 2007 - see http://wpsecure.net/bad-bot-list/
    RewriteCond %{HTTP_USER_AGENT} ^Zeus
    RewriteRule ^.* - [F,L]
    <Files .htaccess>
    order allow,deny
    deny from all
    </Files>

    Thanks for a quick (and hopefully easy) answer!

    ps: that I have to change one line in index.php I understand – no problem there 😉

Viewing 1 replies (of 1 total)
  • Thread Starter webbeetle

    (@webbeetle)

    It worked (as far as I can tell so far) without a flaw to simply combine both htaccess-files!

Viewing 1 replies (of 1 total)
  • The topic ‘How to edit/merge htaccess on existing site (which shall remain up)?’ is closed to new replies.