Articles of htaccess

Block access to wp-admin

I’m attempting to use a .htaccess file to block access to the wp-admin folder. I’ve read through the Brute Force Attacks doc (https://codex.wordpress.org/Brute_Force_Attacks) and I’ve added the block below, using my ip addresses, to the .htaccess file and placed it in the wp-admin folder: # Block access to wp-admin. ErrorDocument 401 default order deny,allow allow […]

htaccess redirects and WordPress

I am migrating from an ancient static web site to WordPress. In the old site, I used htaccess and RewriteRule to simplify URLs and mask the underlying parms. One case was: RewriteRule ^definition/([^/]+) /display-definition?word=$1 [NC] This allowed people to specify a URL of: domain.com/definition/love And under the sheets executed instead: domain.com/display-definition?word=love I have created and […]

Allow logged in users who doesn't belong to whitelisted ips

I have an apache config where I whitelist IPs to a non-WordPress subfolder like this: <Directory /var/www/html/link> Order allow,deny Require all granted #Our Network Allow from ip-address/22 Allow from ip-address/24 Allow from ip-address/24 Allow from ip-address/24 #and even longer list of IPs and other folders </Directory> I would also like to allow people who don’t […]

Restricting user login by IP address

I have a website that is login required in order for users to view the website. I have set up one user for all internal members to use to view the website, however i want to limit just that user to our specific IP address. I can see you can limit access site-wide to an […]

WildCard SSL with wordpress subdomain

So I have a main domain site called: site.com and I recently bought wildcard SSL to try and get the main domain and all its sub-domains to be encrypted and be force all files to use https. After signing up for the service the certificate covers all domains like: *.site.com but all my subdomains have […]

WordPress SSL (https) is not working with custom permalink

I have set up SSL on a site and the homepage is working properly. plus every page and archives are working if the permalink settings are set to default ( Plain ) but its giving a 404 error for all pages and categories if the permalink settings are changed to another option. I am using […]

Problems redirecting to “pretty” permalinks (wordpress in Subdirectory)

I’ve got problems getting pretty permalinks to work. When changing the permalinks (e.g. to month/name), my .htaccess (in the wordpress directory – there is another one one level up) is changed like this: AddType x-mapp-php5 .php AddHandler x-mapp-php5 .php # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /wordpress/ RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f […]

How do I skip wordpress's 404 handling?

I want to extend my website in a way that is parallel to the wordpress theme. Example: My website with wordpress is at: www.mywebsite.com By ftp I added a directory named test, in which there is a php file test.php The problem is that if I write in the url: www.mywebsite.com/test/test.php it redirects me to […]

How to override .htaccess with new rules without ftp or edit it manual

I want script will add new rules to current .htaccess and user no need to ftp or edit it manually. Example, I use timthumb for resize image on my theme and want rewrite the URL and current .htaccess will be something like this. <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^images/thumb/(.*) timthumb.php?filename=$1 RewriteRule ^index\.php$ – […]

How to disable the default WordPress redirect to non-www URLs?

I am trying to redirect all non-www to www URLs in my WordPress MultiSite install. I am using a simple .htaccess rule like this: # Redirect non-www to www: RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] Normally this would work, however WordPress already seems to have a default redirection to non-www URLs. This means […]