There’s quite a bit of confusion over 301 redirects and how they effect SEO and a sites rankings. I’ve extensively used permanent 301 redirects on both my own and SEO client sites and in this SEO tutorial I’ll explain how to use 301 redirects for a Linux Apache server and what you should expect SEO wise. I’ve NOT included a redirect tutorial for Windows Server 301 Redirects since they don’t use a .htaccess file like you use with Apache servers. Also note adding 301 redirects using a .htaccess file is not the only way to add 301 redirects for a website running under Linux, there’s PHP redirects and server side redirects added via Apache config files, so this is just […]
Continue Reading How to Setup a 301 Redirect Within your .htaccess File
How to Hide wp-content/plugins/ folder
Hi David,
how do you hide your plugins?
Thanks
Héctor
How to Hide Website Directories
Hiding a directory is a server side setting.
Assuming you run on an Apache server it’s having something like:
Into your httpd.conf file for each domain on a server, this would make no directories that lack an index.html, index.php etc… show what’s in them.
If you know how to edit the httpd.conf file you’ll be looking for instances of something like this to change:
Another way is create an index.php file and add this to it:
Upload this to any folder you want ‘hidden’, first check there isn’t a index.php file in the directory.
Users now get a blank webpage where ever you upload index.php to. I use this file in Stallion Responsive, load any of the Stallion Responsive folders in a browser like : https://stallion-theme.co.uk/wp-content/themes/stallion-responsive/widgets/
And it’s a white page, simple and effective, stops your visitors snooping inside your themes files and stops Google inadvertently easily spidering and indexing anything in the Stallion Responsive directories that shouldn’t be indexed. I don’t understand why WordPress by default doesn’t do this, doesn’t make any sense to allow users and search engines to see what’s inside /wp-includes/!
I’m not sure if every time you auto update WordPress /wp-admin/ and /wp-includes/ are deleted, if so if you want these hidden you’d have to upload the .htaccess file or the index.php file again after each update.
Best solution is the server side one, but can be beyond a lot of webmasters to edit the httpd.conf file. You might have a setting under your control panel, I use the control panel Virtualmin and I couldn’t find an option so added the code manually which on my servers is under “/etc/httpd/conf/httpd.conf”.
David
How to Hide Website Directories
WordPress .htaccess File
Hi David,
I use bluehost, it shows this way on my FTP session
I tried adding this .htaccess inside of plugins, but it didn’t work
I wonder if it’s because already exists a index.php within the directory?
Regards,
Héctor
WordPress .htaccess File
301 Redirect Everything Under a Directory via .htaccess
Hmm, after rereading what I suggested the .htaccess option isn’t suitable for all directories like /wp-content/plugins/ it would 301 redirect everything under the folder to home rather than just stop users seeing the contents!
I’ve deleted that part of my earlier comment and pasted below with a better modification to explain what it actually does.
How to 301 redirect an entire directory to home.
You have two directories you no longer use and want to 301 redirect everything that used to be in them to home, this could be thousands of images or webpages.
/wp-content/hidden/
and
/oldstuff/
Add this to your root .htaccess file
Note if “RewriteEngine On” is already within the file it’s not needed again.
This would 301 redirect everything under the folders “/wp-content/hidden/” and “/oldstuff/” to my home page.
This can be useful where you’ve deleted hundreds of tags, tags are rubbish SEO wise and should be avoided, if you deleted all your sites tags you could build a set of 301 redirects to conserve the link benefit.
You’ve delete all tags and want them all 301 redirecting:
You’ve deleted some tags called tag 1, tag 2 and tag 3, but kept tag 5 and tag 5
Tag 1 to 3 will 301, the rest won’t be.
Best to try to find a page that’s similar to redirect to rather than just back to home
Above I don’t have a relevant page to tag-1 so 301 to home, but do to tag-2 have a post about tag 2 and have a category similar to tag 3.
I have sites with dozens of 301 redirect rule sets like these.
David
301 Redirect Everything Under a Directory via .htaccess