WordPress.org

Ready to get started?Download WordPress

Forums

Redirection
Case (in)sensitive option? (8 posts)

  1. sgastevep
    Member
    Posted 1 year ago #

    Is there an option I am just missing to make the URL match portion case insensitive? Just got bit by this one as I had one of the site administrators create a redirection for tracking purposes and it wasn't working when the user didn't use the same case for all the letters as the redirection URL had. I went in and modified it to use a regex and did an [Aa] type thing for every letter, but having a check box to make it case insensitive would be very helpful. Thanks!

    http://wordpress.org/extend/plugins/redirection/

  2. paulhastings0
    Member
    Posted 1 year ago #

    Of course we can do this through RegEx like in this example but you have to admit that it's rather time-intensive and that most users of the plugin wouldn't know the first thing about setting up a RegEx expression.

    I totally agree with @sgastevep. A checkbox for this feature would be awesome.

    +1 for a case-insensitive checkbox!

  3. MRC123
    Member
    Posted 1 year ago #

    This would be a fantastic option. It's pain the butt trying to come up with all the various why any one person can type something in.

    Another +1

  4. ccolotti
    Member
    Posted 1 year ago #

    +1000!!! This burns me on a regular basis. I LOVE this plugin but the case sensitivity is certainly a Pain.

  5. alieneila
    Member
    Posted 1 year ago #

    I'm not sure if my option is the best (especially since it involves hacking the core code of the plugin which would be lost on update) but it seems to be working and it might help some of you guys out, this is what I did...

    File: /redirection/models/redirect.php
    Line: 300

    Looking for:

    function matches( $url ) {
    		$this->url = str_replace( ' ', '%20', $this->url );
    		$matches   = false;

    Changing to:

    function matches( $url ) {
    		$url = strtolower($url);
    		$this->url = str_replace( ' ', '%20', $this->url );
    		$this->url = strtolower($this->url);
    		$matches   = false;
  6. JochenT
    Member
    Posted 1 year ago #

    If you want this case insensitive check the 'Regex' option and enter the Source URL with a (?i) in the front:
    (?i)/Ultraspecial-Systems\.html

    As it is an regular expression now some characters like ?, ., [, ], (, ), {, }, ^, $ may have a special meaning and should all be prepended with a backslash like '\.' in the above example.

  7. BjornB
    Member
    Posted 1 year ago #

    +1 for this option. Any chance it will be added?

  8. BjornB
    Member
    Posted 1 year ago #

    Dead silence in here

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic