Regex to append a variable to URLs
I have a regex right now on a WordPress site using Redirection plugin: Source URL: ^/video/(.+) Target URL: /video/$1 And that's working fine. Now, I need to add ?filter=views to the end of the Target URL, but I can't seem to find a way to do it. Desired redirection would be: site.com/video/video-category-name to site.com/video/video-category-name?filter=views Adding /video/$1?filter=views as Target URL adds multiple ?filter=views when I just need the variable added once. Any one that can help me out? Thanks!
You should exclude multiple redirections by using Source URL: ^/video/([^?]+) Target URL: /video/$1?filter=views Explanation if Source URL is ^/video/(.+) then (.+) will match anything after /video/ including after the first redirection : /test match .+ => REDIRECT TO /video/test?filter=views /test?filter=views match .+ => REDIRECT TO /video/test?filter=views?filter=views ... etc. If you allow any character except ? after /video/ then redirection will stop immediately because /video/$1?filter=views won't match Source URL anymore
How can I change this Html Form to Yii framework
How to get log() of a very big number (PHP)?
command line data curl convert to array
Display content based on date and time
How to give a custom name to the PDF being downloaded using FPDF library?
DNS with subdomain doesn't work properly
SMPP: the UDH (User Data Header) appears in the body of sms
Compare 2 arrays and retrieve the differences using PHP
wordpress making a static and dynamic link
for each if true fetch mysqli result
PHP, CodeIgniter, MySQL - SELECT - overloading database
How do I enable member login to a specific directory including sub-directories in wordpress
Uploading mp4 files using PHP
Move files in php with move_uploaded_file [closed]
Count Items in Array PHP
Radio button with same id in Laravel 4.1.x