Support » Plugin: Redirection » [Plugin: Redirection] Proper way to input URLs containing spaces?

  • I have a bunch of redirects in place for some old URLs that contain spaces, and the Redirection plugin does not seem to be handling them how I’d expect.

    For instance, let’s say my old URL is /Ultraspecial Systems.html

    and I want it to redirect to:

    When I input the “source” URL, I tried it using the %20 in place of the space, like so:
    …but this does not seem to get picked up when someone hits that old URL. The user sees the 404 error (and it gets logged in Redirection as a 404) instead of redirecting to the new page I’ve created.

    If I leave out the %20 in the source URL like so:
    /Ultraspecial Systems.html
    …it displays the URL just like that in the Source URL input field, but strips out the space in the link in the Source URL label element, so the link it’s targeting is actually
    …which is incorrect.

    What’s the proper way to input a URL with spaces so it redirects successfully?

Viewing 9 replies - 1 through 9 (of 9 total)
  • I’ve seen the same problem while using the redirection plugin. If there are spaces in the URL’s it just doesn’t work at all – spaces and quotes – quotes as ” or in ascii form.

    Any help or update on this is more than appreciated.

    Check the Regex option and enter the URL as a regular expression as follows:
    If you want this case insensitive you may add (?i) in front of the URL:

    JochenT, thank you so much for your help! This solution totally worked for me.

    Also wanted to mention – if you implement the above solution, the “Source URL” clickable label link will still be handled incorrectly, like so:


    …but that’s fine – if you visit the actual URL (/Ultraspecial%20Systems.html) it will successfully redirect you to the new page. You just can’t click on it from the Redirection rule, which is a perfectly fine trade-off to me since the redirects are working!

    Hi I have tried various methods (including those mentioned above) of getting the following “source URL” with a space in it to redirect with the Redirect plugin but it doesn’t want to work for some reason.
    /Starlink-Website/SheerHost website/coax.htm

    I have just added / as the target URL to redirect to the home page, which works for other URLs just not this one with a space in.

    Any assistance on achieving this would be appreciated.



    I have moved from Blogger to wordpress
    i have successfully redirected all labels to category
    but the problem comes when category has two words and has space in it
    it says 404 Page not found
    so when i manually replace “%20” to “-“
    page show up….
    is it a way to to this for all link? i have more than 500 such links :s

    Want to make it so both show same category page.

    Use this rewrite rule for changing spaces to dashed before passing that to WP

    After Rewrite Engine on:

    RewriteRule (.*)\ (.*) $1-$2

    It will cycle through all the spaces contained in the URL used by the visitors, until there is no more spaces.



    Thank you Franco for your reply
    i added the following line but still 404

    this is my .htaccess

    #Redirect archives
    RewriteRule ^([0-9]{4})_([0-9]{1,2})_([0-9]{1,2})_archive.html$ $1/$2/ [L,R=301]
    #Redirect labels/categories
    RewriteRule ^search/label/(.*)$ category/$1/ [L,R=301]
    RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/([^/]+).html$$3
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule (.*)\ (.*) $1-$2
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # END WordPress

    try placing the custom rewrites after rewritebase / and escaping dots like this: \.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: Redirection] Proper way to input URLs containing spaces?’ is closed to new replies.