• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved can I Speed up apache by not using .htaccess ?

Hotte

New Pleskian
Is it possible and sensefull to not use .htaccess and store the content of .htaccess in vhost ?

Doese that make sense and where should i paste my .htaccess stuff in Plesk?

thanks and regards from cologne
Hotte
 
THX,

Do i use http or https ?
I think i do rewrite to https in http everything else (also auth!) in https ?
or just the same content in each?

And is this already gaining performance (may be for ttfb?) or do i need to disable htaccess thein in apache conf ?
 
THX,

Do i use http or https ?
I think i do rewrite to https in http everything else (also auth!) in https ? or just the same content in each?

And is this already gaining performance (may be for ttfb?) or do i need to disable htaccess thein in apache conf ?

In "Apache & nginx Settings" —
If you put this in both Additional Apache directives HTTP and HTTPS sections:
<Directory /path/to/document/root/httpdocs>
AllowOverride None
</Directory>


And this in the Additional nginx directives section:
location ~ /\.ht {
deny all;
access_log off;
log_not_found off;
}
if ($scheme = http) {
return 301 https://$server_name$request_uri;
}


You'll be well on the way. Apache will then avoid searching for any .htaccess files in your directory tree and will not read them if they exist, and Nginx will not allow people to read them. All you have to do is put all occurrences of directives you need from the .htaccess files into more <Directory> sections in the Additional Apache directives section to make it all work. Nginx will redirect all the HTTP to HTTPS requests before they even get to Apache. I run several WordPress sites without .htaccess enabled this way — you just have to be alert to the existence of new .htaccess files that are needed and write their contents into the <Directory> directives.
 
Back
Top