Just to give you guys an update on the status of AWS:MRT, I rewrote the Regex to match the RewriteRule string so that it properly picks up escaped white space within the string. Example: RewriteRule a\ b c\ d [Flags] will now match and there is no longer a requirement to replace spaces with the Regex space character \s. This is a big improvement. I am still working on updating the parseModRewrite function to support these new Regular Expressions but I will post the new code when it is ready. I will also rewrite it so that it properly handles the RewriteCond strings that use the OR flag. A big change is on the way for this project!
UPDATE 10/21/2013: School is keeping me from getting any of my projects finished. Next semester will be easier since I will only be taking three courses instead of four. Unfortunately, development has come to a halt. What this means is that I am having trouble finding enough time to work on it. The good news is that the parser function has been written so the hard part is over. In the mean time, I will try and find some free time to work on this project.
UPDATE 08/23/2013: Hard to believe it's almost been a month since my last update. Anyway, development is on going but it is taking some time. I went back to College for a Programming degree so I am keeping myself busy. Hang in there.
UPDATE 07/27/2013: One more update to the parseModRewrite and I promise this will be the last. It turns out that the [R] flag is also used to report errors to the client. Unfortunately, the new regex only supported the range between 300 and 399. In light of this, I modified the regex to support codes between 300 and 999. AWS:MRT will decide what option the user should choose based on the code. So whether it's a regular redirect or error, it will handle it flawlessly. The new function code has been updated. Enjoy!
UPDATE 07/26/2013: The parseModRewrite function has been updated to improve the regex patterns and to fix a small bug that causes the wrong error code to show when RewriteBase contains a syntax error. It also limits the condition variable to word characters and checks to see if the redirect status code is between 300 and 399 if the R flag is used. A few small enhancements have also been added. Enjoy!
UPDATE 07/25/2013: Just when I thought the parseModRewrite function was completely ready, something had to go wrong. When a RewriteCond variable has quotes around it (possible, but unlikely), it will report a syntax error. I am fixing this right now. Also, I will remove the path fixing of the replacement URL since it should already have one when a RewriteRule is not preceded by a RewriteBase. Both bug fixes are on the way and the function will be ready by the end of the day. Hey, that rhymed!
UPDATE 07/24/2013: The parseModRewrite function has been updated to fix the path to the regex and replacement if necessary. The array has also been modified to remove the 'rule' index. It wasn't necessary. Take a look at the demo. This will be the final update to the parseModRewrite function.
AWS:MRT is under full development!
UPDATE 07/23/2013: It turns out that the extra conditional patterns work with Abyss Web Server. I may or may not include a regex to check for these patterns since the function's job is to only to parse the Mod Rewrite information. It will ultimately be AWS:MRT that handles the majority of the work. The updated function will also correct paths in the regex for rules that are not preceded with a RewriteBase directive. AWS:MRT 1.0 already handles this job but I think it would be nice to hand that task over to the function. You can download the new function tomorrow.
UPDATE 07/22/2013: It turns out that Abyss supports extra conditional patterns that are not mentioned in the Mod Rewrite Conversion tutorial. The extra patterns are numerical comparison. I'm looking into this. Hang in there because development has already begun.
UPDATE 07/21/2013: I am pleased to announce the official release of the all new parseModRewrite function. AWS:MRT 2.0 development starts tomorrow! :D
Download the function from:
http://trustabyss.com/dev/php/functions/parseModRewrite.txt
[DEMO]
http://www.trustabyss.com/dev/php/functions/parseModRewrite.php
htaccess file:
http://www.trustabyss.com/dev/php/functions/htaccess.txt
UPDATE 07/20/2013: The parseModRewrite function is near to its completion. When you see the source code, you will definitely be able to tell it's not the original code. The old function utilized 109 lines of code, and that included both the comments and PHP tags. The new function has 381 lines of code! That also includes the comments and PHP tags. This thing is a beast! Get ready for AWS:MRT 2.0 because it's on the way!
UPDATE 07/18/2013: The parseModRewrite function can now handle RewriteCond conditions that use the OR flag. It will attempt to combined them, and if it fails, it will let the user know. It took a lot of trial and error to get it right but it works flawlessly. It even handles start and end anchors. I hope to release the new function to you guys soon. It is still under development.
UPDATE 07/16/2013: The parseModRewrite function is in development