Monday, April 21, 2014
   
Text Size
Login

301 Redirect using htaccess file

What?
There are a lot of articles & posts out there that cover the same topic, but as this took me the good part of an hour just to find out, I'm posting it here so I never have to look for it again.

A client changed their website domain address and wanted any person visiting the old domain to be redirected to the new domain.

Why?
I warned that a 301 site gets removed from the Google directory and true to form Google have removed it. Not sure why nobody believed me when I raised the alarm but hey-ho.

How?
I'm going to show you how to do this with a .htaccess file:

htaccess Rewrites SEF URL and submits to PHP

What?
A quick note on a htaccess rewrite rule I'm liking.

What does it do?
What I type:

  1.  http://www.mywebsite.com/blog/videos.html 
Sends this to server:

  1.  http://www.mywebsite.com/index.php?myFolder=blog&myFiles=videos 
How?

A picture of the Internet


Just a pretty picture on how hackers have created an infographic of the internet:

Infographic of the Internet

Source: BitBucket.Org - Internet Census 2012

Code Troubleshooting Checklist

So I've started this list to make sure I don't spend so long anymore on debugging code. The aim of this article is to quickly suggest ways of pinpointing the source of the problem:

Basic Tests for SQL-Injection Vulnerabilities

What?
I'm putting this article here so that I can run through a checklist when I am adding an input field to an interface.

Why?
There is a strange complacency in many applications released for public use which are vulnerable to SQL Injection. According to the industry over 60% of attacks on websites is through SQL-Injection alone.

How?
SQL-Injection is not as complicated as it is made out. An input field in a website form is where the hacker can add code that can drastically affect a database-driven website. Take a search engine for instance, this is a field which the end-user can freely enter any text they want, especially any code. But a search engine is just one example, you need to test EVERY input field the end-user can access. For more information on SQL-Injection, please read my article "Anti-SQL Injection Basics".

Tips

Latest Posts

  • 301 Redirect using htaccess file

    • Tue 15-Apr-14
      Further suggestion:
      RewriteRule ^(.*/)?assets/s 2dmain.html\?/( .*/)? $2 [R=301,L]
      Webmaster  
    • Thu 10-Apr-14
      Playing with some RegEx testers
      RewriteRule ^(.*\?/)?(?:$|( .+?)(?:(\.[^.]$ )|$)) $2 [R=301,L] ...
      Webmaster  
    • Wed 09-Apr-14
      I tried to redirect links from my old site to my new site, based on what I read in this thread. The old ...
      pelle
  • Joes Revolver Map (JRM)

    • Sun 20-Apr-14
      Hello, is it possible to use this module also in joomla 3.2? Thanks Manfred
      Manfred V.
  • K2 Items disappear

    • Thu 03-Apr-14
      The fix works great, but the problem is occurring a couple of times a day. Any idea how to fix ...
      Larry C.