This is a very short and quick solution for web designers. The situation of today is an style link becomes trashed when having any kind of white spaces just before the closing
Imagine a link like:
<a title="example"> example </a>
will result in a display like:
example
This is a bug of all browsers I know, but there is a quick PHP fix for it:
$html_source = preg_replace( "/\s+<\/a>/i", "</a>", $html_source );
Pattern matching using "*" and "?" wildcards is the common approach under Windows when it comes to comparing paths. Many applications - lead by DOS, cmd.exe and explorer.exe (the Windows Explorer) - allow users to use wildcards in paths. Users thereby are enabled to select a group of files matching specific criteria, which is often used in the "open document" dialog of Windows applications.
Matching a string agains a pattern is a very simple thing if you've got a framework or interpreted high level language like PHP or C# (or any of the .NET Framework languages). Those languages already provide classes or functions for using Regular Expressions (RegEx) and thus allow for very complex string comparison, string matching and string replacement features out of the box.
The same topic can become rather complicated when you're (for what reason ever) are limited to pure C and don't want or just can't include complex classes. As I had the same problem and luckily solved it, I decided to provide you the surprisingly very simple C code for matching a string against a pattern containing wildcard if you like.
Redirecting whole websites or single webpages with mod_rewrite is a very important feature when doing search engine optimization (SEO) or when moving from one webserver or domain to another.
Redirection is usually done with a small block of code that is added to an .htaccess file in your websites root path. The code snippet looks like:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.example\.com$
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
It is often misunderstood and the bulletin boards have hundrets of incomplete or wrong assumptions about Apache and mod_rewrite. That's why I decided to write an article about it.