1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Is there an order to placing commands in .htaccess file?

Discussion in 'Apache' started by gregory65, Apr 30, 2021.

  1. #1
    I have to keep the below block at the bottom of my htaccess file or other commands won't work. Why? I didn't think there was any order to commands in the Apache file. Is that right?
    # BEGIN WordPress
    #NEEDS TO BE AT END OF FILE OR HIDE DEBUG FILE CODE DOESN'T WORK
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    SEMrush
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]
    # END WordPress
     
    gregory65, Apr 30, 2021 IP
    SEMrush
  2. qwikad.com

    qwikad.com Illustrious Member Affiliate Manager

    Messages:
    6,762
    Likes Received:
    1,481
    Best Answers:
    25
    Trophy Points:
    425
    #2
    RewriteEngine On and RewriteBase / should be placed just once at the top of the .htaccess file. Don't use them again and again.
     
    qwikad.com, Apr 30, 2021 IP
  3. gregory65

    gregory65 Greenhorn

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #3
    Thank you for the reply. I moved the block to file top and commented out the multiple RewriteEngine On. I had only one RewriteBase / which was in the block. Doing this exposed the debug.log
     
    gregory65, Apr 30, 2021 IP