.htaccess - How to match right single quotation mark character in an Apache RewriteRule -


i'm trying following url: http://olddomain.com/macmillan’s-st-luke-passion

which contains right single quotation mark character (http://www.fileformat.info/info/unicode/char/2019/index.htm)

to redirect new location. however, cannot apache this.

for reference redirect code (in virtualhost) follows:

rewriteengine on rewriterule ^macmillan\xe2\x80\x99s-st-luke-passion$  http://newdomain.com/tickets/events/macmillans-st-luke-passion  [r=301,l] 

the file has other redirects exact matching urls, , 1 catch redirect @ bottom of page. 1 intended match remaining urls /events/(old url). example send olddomain.com/page-title newdomain.com/events/page-title

redirect 301 / https://newdomain.com/events/ 

what's happening @ present apache ignoring specific rule contains \x encoded string right quote character ’

and falls through fallback redirect sends url wrong place.

can how match url right quote character ’ in apache rewriterule (or redirectmatch)?

thanks!

try rule in virtual host config file:

rewriteengine on  rewriterule ^/?macmillan\xe2\x80\x99s-st-luke-passion$ http://newdomain.com/tickets/events/macmillans-st-luke-passion [nc,r=301,l] 

leading slash required while matching in apache or vhost config not when used in htaccess. make sure test in new browser avoid old cache.


Comments

Popular posts from this blog

c# - SharpSsh Command Execution -

python - Specify path of savefig with pylab or matplotlib -

How to run C# code using mono without Xamarin in Android? -