Force SSL/https using .htaccess and mod_rewrite

For Apache, you can use mod_ssl to force SSL with the SSLRequireSSL Directive: This directive forbids access unless HTTP over SSL (i.e. HTTPS) is enabled for the current connection. This is very handy inside the SSL-enabled virtual host or directories for defending against configuration errors that expose stuff that should be protected. When this directive … Read more

.htaccess redirect all pages to new domain

The below answer could potentially cause an infinite redirect loop… Here, this one redirects everything after the domain name on the URL to the exact same copy on the new domain URL: RewriteEngine on RewriteRule ^(.*)$ http://www.newdomain.com/ [R=301,L] www.example.net/somepage.html?var=foo redirects to: www.newdomain.com

How to enable mod_rewrite for Apache 2.2

In order to use mod_rewrite you can type the following command in the terminal: sudo a2enmod rewrite Restart apache2 after sudo /etc/init.d/apache2 restart or sudo service apache2 restart or as per new unified System Control Way sudo systemctl restart apache2 Then, if you’d like, you can use the following .htaccess file. <IfModule mod_rewrite.c> RewriteEngine On … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)