Block access to wp-admin

Placing the htaccess file in the wp-admin directory did not work for me so I went a different route and it seems to be working very well. Below is what I have in my main htaccess file: <files wp-login.php> # set up rule order order deny,allow # default deny deny from all allow from x.x.x.x … Read more

htaccess redirect – directory and subpages to a single page

The solution is to put the rewriterule just after RewriteEngine On. <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^definicje(.*)$ http://example.com/single-page/ [R=301,L] RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule>

htaccess: Remove trailing slash from URL ending with .xml/ only

If you’re outputting a sitemap, there’s no reason to wait for the query for your page- which is what is producing the redirect. Hook an earlier action and you won’t need anything to counter the trailing slash, because it won’t happen- EDIT Here’s a complete version with registering query vars, rules, and parse_request action: // … Read more

WordPress-site can be reached on x.x.x.x/index.php – but not directly on the IP without index.php

Is this normal behaviour? Yes. On a default Apache install, only index.html is set as the DirectoryIndex (the default setting). Either in the appropriate <VirtualHost> container, or main server config you need to add a <Directory> section that specifically targets the defined document root directory. For example: DocumentRoot /var/www/html <Directory “/var/www/html”> # Allow public access … Read more

Custom url for a single page

Read on htaccess. You can try this, <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^phones$ /?page_id=1081 [L] </IfModule>