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

java - HTTP Status 500 - An exception occurred processing JSP page /second.jsp at line 15 -

SQL Server - MyCTE query based on 24 hour period (next day) -

php - Using str_replace to translate a MySQL Table in html -