The Code-Bin
parseModRewrite()
Posted by: TRUSTAbyss | March 16, 2009 @ 3:05pm
Revision 31 - Original post on November 7, 2007 @ 7:55pm

PHP Code



Syntax Highlighting





Author Comments
The parseModRewrite() function can be used to parse an htaccess file that contains Mod Rewrite directives, which can then be used to create a translator (e.g. AWS:MRT) for Abyss Web Server's URL Rewriting engine. This function is only recommended for advanced programmers that know how to work with multi-dimensional arrays.

Updated: March 16, 2009
-------------------------------------------------------------
The above code has been updated to ignore Rewrites that contain a "-" in the replacement URL of a RewriteRule. Abyss doesn't use the same URL Rewriting engine as Apache, so it has no need to use these types of Rewrites. The RewriteRule regular expression has also been modified so that "[" or "]" can be used in the replacement URL of a RewriteRule. Last but not least, RewriteCond's or RewriteRule's that contain whitespace are now escaped with the whitespace character \s. This keeps the translating going, even if it runs into a regular expression like "^Internet\ Explorer."
Rating


4.60 / 8
493 Votes