A
A
AstonMartin2016-07-10 07:37:12
Apache HTTP Server
AstonMartin, 2016-07-10 07:37:12

How to replace comma in htaccess?

Hi all!
Help, plz, a little with the regular season?
There are requests for a site like:

/index.php/topic,109806.msg40759.html#msg40759
/index.php/topic,108936.0.html
/index.php/board,1.0.html

And here is the current htaccess:
RewriteEngine On

RewriteCond %{QUERY_STRING} ^topic=(\d{1,7})\.(\d{1,5})$
RewriteRule ^index.php$ index.php/topic,%1.%2.html

RewriteCond %{QUERY_STRING} \.html$ [NC]
RewriteRule ^(index\.php/.*)$ /$1,%{QUERY_STRING}? [L,NE,NC,R=301]

RewriteCond %{QUERY_STRING} .*topic.*
RewriteCond %{REQUEST_URI} .*topic.*
RewriteCond %{REQUEST_URI} .*html.*
RewriteRule ^(.*)$ /$1? [R=301,L]

It is very necessary to add a rule according to which all commas in the url are replaced by dots. And it is desirable that something else does not break))
Tell me what to add to htaccess?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey, 2016-07-13
@Azperin

And what will break if you put an escaped dot or even an ordinary one instead of a comma (I don’t remember if it should be escaped there at all)?

V
Viktor Taran, 2016-07-15
@shambler81

Indeed, what will break for you if you change the comma to any character is not so critical for you, and this problem is critical, and there are a million options for solving it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question