SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot XandroZ's Avatar
    Join Date
    May 2006
    Posts
    147
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Apache mode_rewrite

    I need to make aredirect from an old url to a new url. The problem is that both urls have a space :

    Example:
    HTML Code:
    http://www.jaec.info/Ext-Direct/Web%20php-html/Tutorial/SQL/Id56%20free%20sql%20tutorial.php
    How can I resolve this problem because apache doesn't recognize space.

  2. #2
    SitePoint Wizard rguy84's Avatar
    Join Date
    Sep 2005
    Location
    Durham, NC
    Posts
    1,659
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    a space is equal to %20, this may help you: http://www.webmasterworld.com/forum92/606.htm
    Ryan B | My Blog | Twitter

  3. #3
    SitePoint Zealot XandroZ's Avatar
    Join Date
    May 2006
    Posts
    147
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know that, the problem is that apache doesn't recognize space as %20 or escaped with "\"

    In the example on webmasterworld the Rewriterule convert an url with space to an url with "_", so instead "aston martin" it will go to "aston_martin", just replace the character

    I want to redirect an old url that have spaces to a new url that also have spaces.In my case "protocols eib" I want to redirect to "automation protocols" , I don't replace characters, I want to redirect an url to another url that is distinct.

  4. #4
    SitePoint Member
    Join Date
    Feb 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Since both urls have spaces you can't do a full on mod_rewrite, simply because mod_rewrite doesn't allow spaces in the redirect.

    What you can do though for the time being is:
    - create a symlink for that page
    - edit the php in that page, so that the header sends a 302 followed by a redirect
    Code:
    header('Location: /some_folder/some file here.php', 302);


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •