The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Can't redirect files with spaces in the name

Discussion in 'General Discussion' started by Vigothe6th, Oct 3, 2006.

  1. Vigothe6th

    Vigothe6th Registered

    Joined:
    Oct 3, 2006
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    The person that ran the company's site before me used many needless pdf files and had spaces and ampersands in the file names. I am now trying to redirect the old files to point to html files using cpanel. The few old files that did not have spaces are redirecting fine but those that have them don't work. If I type in the url of a page that had a space I get a 404 error.
    Example:
    Old location: http://www.mydomain.com/Brochures/Trucks & installations/Specialty Installations Brochure.pdf
    New location: http://www.mydomain.com/atv.html

    Cpanel automaticaly converts the spaces to %20 so I thought that maybe the ampersand was the problem so I manually changed that to %26 but still have had no luck.

    What am I missing?
     
  2. angelina_holy

    angelina_holy Well-Known Member

    Joined:
    Aug 6, 2006
    Messages:
    113
    Likes Received:
    0
    Trophy Points:
    16
    Kindly login to filemanger and remove the spaces in the files say Trucks & installations

    Rename the file Trucks & installations as Trucks&installations and then set the redirection . from cpanel>>redirect
     
  3. Vigothe6th

    Vigothe6th Registered

    Joined:
    Oct 3, 2006
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    But the problem is people still have bookmarks to the pages with spaces in them and some of the search engines are still listing them even though they have not existed for over a month.
     
  4. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    You would most likely need to url-encode certain characters for them to work properly:

    Code:
    http://www.mydomain.com/Brochures/Trucks%20&%20installations/Specialty%20Installations%20Brochure.pdf
    Note: The above is just a hint - I merely replaced the spaces with their url-encoded equivalent (%20). You'd probably need to url-encode the ampersand character too.
     
  5. Vigothe6th

    Vigothe6th Registered

    Joined:
    Oct 3, 2006
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Sorry, my first message wasn't very clear on that part. It looks like Cpanel automatically url-encodes the spaces but I have also done it myself and I have encoded the ampersand as well and still have had no sucess.
     
Loading...

Share This Page