All .htacces and mod_rewrite answered - examples, tips and tricks Forum Index  

All .htacces and mod_rewrite answered - examples, tips and tricks Forum Index -> URLs - other tricks -> Repair wrongly parsed adress
Author Message
admin
Site Admin


Joined: 18 Jul 2006
Posts: 89

PostPosted: Tue Jul 18, 2006 8:57 am    

Repair wrongly parsed adress

Reply with quote

This is much more robust version of simple trailing dot and comma removal, mentioned in other thread. It checks if the adress is exists and it removes . ? ) , ! - " and ' at the end.

Code:
RewriteEngine On
#RewriteBase  /adresar
RewriteCond %{QUERY_STRING} ^(.*[^\.\?\),!-"'])[\.\?\),!-"']+$
RewriteRule ^(.*)$ $1?%1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-F
RewriteRule ^(.*[^\.\?\),!-"'])([\.\?\),!-"'])+$ $1 [R=301,L]

Source:http://www.jakpsatweb.cz/server/mod_rewrite/mod-rewrite-priklady.html
Back to top
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.   
View previous topic
View next topic
All .htacces and mod_rewrite answered - examples, tips and tricks Forum Index
Page 1 of 1
Jump to:  
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 vote in polls in this forum
FreeMind 1.1 Template by AU Templates