I'm trying to accomplish something similar to the following, where everything after the domain name would parse into a php GET.
http://en.wikipedia.org/wiki/A.W.O.L.
However I'm having trouble preserving trailing periods using rewrite. Unless there is some content after the period, the htaccess simply truncates the url to the last "normal" character (i.e. letter, number, etc.). In the case of the example above, what my GET would get is "wiki/A.W.O.L" (notice there is no longer a period after the "L").
These parameters must match exactly against a database of authors and titles, many of which are enclosed by periods and other punctuation marks. So this behavior certainly wouldn't work for me. This doesn't happen when I simply pass the string directly to index.php?a="..." -- only when using the mod_rewrite. I tried playing around with regex, but haven't been able to figure it out. How did the guys at Wikipedia do it?
Here's the cruddy code I currently have in my htaccess file:
Code: Select all
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php?a=$1 [L]