php - htaccess rewrite specific parameter with dot -


i have issue rewrite url like:

http://examplepage.com/news/?aid=n_557eb95ed07360.45147988 

to

http://examplepage.com/some-other-name 

but needs url if parameter changes should nothing. think problem dot in parameter?

my current .htaccess matter this:

rewritecond %{query_string} ^aid=n_557eb95ed07360.45147988$ rewriterule ^news/$ /some-other-url [nc,l] 

any appreciated. thanks.

as drakes said, adding escape dot should trick.

rewritecond %{query_string} ^aid=n_557eb95ed07360\.45147988$ rewriterule ^news/$ /some-other-url [nc,l] 

or, if aid going dynamic, can use:

rewritecond %{query_string} ^aid=(.*)$ 

and if want search aid part of query:

rewritecond %{query_string} !(^|&)aid=(.*)$ 

Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -