mod_rewrite
July 5, 2019, admin, 0
I have added the following to my .htaccess file (password protected) to limit the access to wordpress login pages. ErrorDocument 401 “Unauthorized Access” ErrorDocument 403 “Forbidden” <FilesMatch “wp-login.php”> AuthName “Authorized Only” AuthType Basic AuthUserFile /home/user/.htpasswd require valid-user </FilesMatch> But after the change, the page won’t load, it gave out a infinite loop More
Like this:
Like Loading...
July 26, 2017, admin, 0
To force your website with SSL using htaccess and mod_rewrite, use the following rule in the website’s .htaccess. RewriteEngine On RewriteCond %{HTTP_HOST} ^yourwebsite\.com [NC] RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://yourwebsite.com/$1 [R=301,L] If it’s a subdomain, use this. RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteCond %{REQUEST_URI} sub RewriteRule ^(.*)$ https://yourwebsite.com/sub/$1 [R=301,L] Note: Replace yourwebsite.com with the More
Like this:
Like Loading...
March 16, 2016, admin, 0
Suppose you have installed wordpress in root directory of your account. There is a folder/directory, say docs in the same (root) directory. You will not be able to access this folder like www.mysite.com/docs url. The wordpress will redirect to a 404 page instead. To override the wordpress rewrite rules, add the following line to .htaccess More
Like this:
Like Loading...