Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

How do I keep code after redirects in .htaccess?

Discussion in 'General Discussion' started by primerano, Jan 10, 2013.

  1. primerano

    primerano Registered

    Joined:
    Sep 13, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    In order for my redirects to work on a site that has wordpress installed I need to put the redirects before the wordpress htaccess code.

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

    # END WordPress


    The problem is that as you add new redirects it adds them after this block and they won't work as the wordpress rules will fire 1st.

    Is there a way to make new redirects not come last?

    Or maybe I can include the wordpress rules via a separate file (assuming I can force this include to be the last line).

    Any pointers?

    Thanks
    Tony
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice