HTACCESS: Like for Like URL Redirect

Redirect all URLs to new URLs. This works when a site is moved to a new location and visitors need to be redirected from old URLs to new URLs and the new URLs are only changed by domain, subdomain or subdirectory. For example,  this would work when you need to redirect from example.com/post-1 to new.example.com/post-1 or when you need to redirect from example.com/a-post to example.com/directory/a-post. Redirect from old domain to new domain Create an .htaccess file in the root directory of the site's old location Add this snippet to the top of the .htaccess file # Set the domain the … [Read more...]

Missing Apache2 Module mod_env in Ubuntu? Follow This…

So easy to fix but hard to find the solution. Hope this helps all you who are stuck with this. If your Apache server doesn't start and you get an error message like this: Failed to start apache : * Starting web server apache2 Syntax error on line 63 of /etc/apache2/sites-enabled/mythweb.conf: Invalid command 'SetEnv', perhaps misspelled or defined by a module not included in the server configuration Action 'start' failed. The Apache error log may have more information. ...fail! It means you need to enable Apache module mod_env. A simple check for the module with sudo a2enmod at … [Read more...]

How to Change the Name of index.php in WordPress

They say it can't be done. Read support requests in the WordPress forum and you'll see lots of people saying it's not possible to change the name of index.php to blog.php or site.php or anything else.php. But it can be done. I know it. I've done it. Here's how... Change the Name of index.php Changing the name of index.php is very straightforward. In these examples we will rename index.php to blog.php Open .htaccess file of the root site for editing Change every instance of index.php to blog.php Change every instance of index.php to blog\.php to blog\.php Add the directive … [Read more...]

Getting Rid of the WWW for WordPress Multi-Sites

I had a brainwave today. A good'n. More like a tsunami than a brainwave. For a couple of weeks I've been figuring ways to ensure the URLs for all my sites are written with the www hostname dropped. This should be an easy task. In most cases we can just do something like: RewriteCond %{HTTP_HOST} ^http://www\.example.com [NC,OR] RewriteCond %{HTTP_HOST} ^www\.example.com [NC] RewriteCond %{HTTP_HOST} !^example.com [NC] RewriteRule ^(.*) http://example\.com/$1 [L,R=301] Which tells the server to look for URL requests beginning http://www.domain.tld or URL requests beginning www.domain.tld … [Read more...]

WordPress Security Hardening with .htaccess Rules

This way of protecting your website uses a combination of htaccess rewrite rules to harden WordPress sites at the server level, plugins to harden WP sites at the site level i.e internally, and plugins to detect changes to files and the database SQL injections. There's no need to be squeamish. Toughening WordPress is easier than it looks but there are caveats: No site or server can ever be 100% secure from malicious bots, hacker scripts or other non desirables. Denial of Service (DoS) attacks require a very different method of site protection. The site defence methods shown here have … [Read more...]

Are You Getting Open_BaseDir Restriction Errors From Scripts and WordPress Plugins?

I don't know a secure solution but I do know the cause. The cause is a PHP security restriction. It's a good one to have and shows your host cares about you and other users on your server. A typical open_basedir error looks like this: PHP Warning: file_exists(): open_basedir restriction in effect. File(/var/www/your-website/wp-config.php) is not within the allowed path(s)... The open_basedir restriction is a security feature used on some servers. It prevents hackers from getting into different areas of your hosting space by, for example, exploiting a php script bug to upload a PHP shell … [Read more...]

All original content on these pages is fingerprinted and certified by Digiprove
Loading

Invite Friends to ‘JournalXtra’

Supercharge your web design skills with JournalXtra

Buy me lunch!

I'm a cheap date. Where else can you buy lunch for a couple of dollars?

I accept Bitcoin too!

Categories

Dynamik Website Builder
WPMU DEV - The WordPress Experts
StudioPress Theme of the Month