xxxxxxxxxx
//htaccess file change
cd /etc/apache2/ && sudo cp apache2.conf apache2.test.conf
sudo nano apache2.conf
<Directory /path/to/your/project>
AllowOverride All
</Directory>
cd /home/ubuntu/staging/current
sudo nano .htaccess
sudo chmod 644 .htaccess
sudo a2enmod rewrite
sudo systemctl restart apache2
//.htaccess content
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Redirect Trailing Slashes...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Rewrite "index.php" and other files that do not exist
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
# Handle 404 errors with CodeIgniter
ErrorDocument 404 /
xxxxxxxxxx
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
xxxxxxxxxx
//header php----
header("Cache-Control: no-store, max-age=0");
header("Pragma: no-cache");
header("Clear-Site-Data: \"cache\", \"cookies\", \"storage\"");
------
//htaccess file change
cd /etc/apache2/ && sudo cp apache2.conf apache2.test.conf
sudo nano apache2.conf
<Directory /path/to/your/project>
AllowOverride All
</Directory>
cd /home/ubuntu/staging/shared
sudo nano .htaccess
sudo chmod 644 .htaccess
sudo a2enmod rewrite
sudo systemctl restart apache2
//deploy.sh add
ln -s ../../shared/.htaccess $NOW/.htaccess || exit 1
//.htaccess content
# Handle 404 errors with CodeIgniter
ErrorDocument 404 /
----Http Headers set ----------------------
apachectl -M | grep headers //if enabled headers
apachectl -M | grep rewrite
sudo a2enmod headers
sudo systemctl restart apache2
//.htaccess content
<IfModule mod_headers.c>
Header always set Referrer-Policy "no-referrer"
Header always set Content-Security-Policy "default-src https: 'unsafe-eval' 'unsafe-inline';"
Header always set X-Content-Type-Options "nosniff"
Header always set X-DNS-Prefetch-Control "off"
Header always set X-Download-Options "noopen"
Header always set X-Frame-Options "sameorigin"
Header always set Strict-Transport-Security "max-age=31536000 ; includeSubDomains"
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
------END----------------------------------
xxxxxxxxxx
##Add a Trailing slash
# FROM: http://was-mit-internet.de/unterseite/filename.html
# TO: http://was-mit-internet.de/unterseite
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ https://www.domainname.tld/$1/ [L,R=301]
xxxxxxxxxx
php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value memory_limit 256M
php_value max_execution_time 300
php_value max_input_time 300
xxxxxxxxxx
RewriteEngine on
RewriteBase /foldername/
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
AddDefaultCharset utf-8
xxxxxxxxxx
# No extern use from your images
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?domainname.de [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ https://domainname.de/hotlink.jpg [NC,R,L]
xxxxxxxxxx
<IfModule mod_rewrite.c>
# That was ONLY to protect you from 500 errors
# if your server did not have mod_rewrite enabled
RewriteEngine On
# RewriteBase /
# NOT needed unless you're using mod_alias to redirect
RewriteCond %{REQUEST_URI} !/public
RewriteRule ^(.*)$ public/$1 [L]
# Direct all requests to /public folder
</IfModule>
xxxxxxxxxx
# Browser Caching
ExpiresActive On
ExpiresByType image/jpg "access 1 month"
ExpiresByType image/jpeg "access 1 month"
ExpiresByType image/gif "access 1 month"
ExpiresByType image/png "access 1 month"
ExpiresByType image/x-icon "access 1 month"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresDefault "access 3 days"
xxxxxxxxxx
ewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]