HeaderEditor
HeaderEditor copied to clipboard
[Question] Help making a rule
Hey, I've been struggling to make a specific rule for a while now. I'm in Turkey right now, but I don't like how websites usually load in Turkish (generally it will be website.com.tr
). I have made rules to redirect some sites, such as Amazon, but I need help with one site in particular. Also, I don't have too much programming knowledge, so I've been struggling.
So, imagine the site is website.com.tr/content
. I require it to redirect that to usa.website.com/content?ignoreredirects=true
. The main part I'm struggling with is preserving the 'content' part of the site, because it is between two things. I tried looking into regex, but couldn't really figure it out. Thank you for your time.
/([^/]+\/\/)(w+\.)?([^/]+)\.tr(\/[^?]+)\??(.*)?/
/([^/]+//)(w+.)?([^/]+).tr(/[^?]+)??(.*)?/
Thanks a lot, but where in the url do I put this?
val.match(/([^/]+\/\/)(w+\.)?([^/]+)\.tr(\/[^?]+)\??(.*)?/)
then you will get a array, and then you can do it by yourself.