htaccess Elite

.htaccess tutorial


All times are UTC [ DST ]





Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Rewriting urls with trailing periods
PostPosted: 20 Jul 2008 03:14 
Offline

Joined: 20 Jul 2008 02:41
Posts: 1
Hi,

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:
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php?a=$1 [L]


Thanks for any advice.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB