RE: Is there an order to the .htaccess file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Eric,

 

I very much appreciate your answer! It appears setup is as needed/described. This is why it’s puzzling that this one standard code block prevents the hide debug code from working.

 

Our system admin tells me that rewrite in Apache is enabled.

 

Our system admin also tells me that "AllowOverride All" is enabled in the <Directory> subdirective under <VirtualHost> for the domain..

 

<Directory /xxx/xxx/xxx>

   AllowOverride All

   RewriteEngine on

  </Directory>

 

 

I don’t have permissions even under sudo to restart Apache on this server.

 

 

Is there an order to the .htaccess file? Does it matter which directive comes before the other?

 

Thanks,

Lisa

 

From: Eric Shields | #MassTransitHonchkrow <masstransitkrow@xxxxxxxxxxxxxx.INVALID>
Sent: Monday, May 3, 2021 9:05 PM
To: users@xxxxxxxxxxxxxxxx
Subject: Re: [users@httpd] Is there an order to the .htaccess file

 

You'll need to enable rewrite in Apache in order for rewrite rules to work. Also, make sure that "AllowOverride All" is enabled in the <Directory> subdirective under <VirtualHost> for the domain you wish to enable this on. Otherwise, the .htaccess file will be ignored by the virtual host.

 

Type the command "sudo a2enmod rewrite.load" and then restart apache. For systemd users, type "sudo systemctl restart apache2". If you forget sudo, it will ask for your password anyway.

 

Eric Shields 🚏 MassTransitHonchkrow

Ask me about the Krowverse Suite of Services.

 

 

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Monday, May 3rd, 2021 at 8:59 PM, Di Gregorio, Lisa <ldigregorio@xxxxxxxxxxx> wrote:

Hello,

 

I have to keep the below block at the bottom of my .htaccess file or the directive I have to hide the debug file won’t work. So far, I have tried moving this block to the top of the file and allowing for one  and only one of

RewriteEngine On in the file and one and only one of RewriteBase /     This doesn’t make a difference. The debug file still won’t be hidden when following this format. Does anyone have any other idea as to why this block must be at the bottom of the .htaccess file, which also means all other code needs to be placed above this block.  Thank you!

 

 

# BEGIN WordPress

#NEEDS TO BE AT END OF FILE OR HIDE DEBUG FILE CODE DOESN'T WORK

RewriteEngine On

RewriteBase /

RewriteRule ^index\.php$ - [L]

 

# 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

 


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux