Results 1 to 3 of 3

Thread: htaccess to change URLs on the fly?

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2001
    Location
    Quebec, Canada
    Posts
    43

    htaccess to change URLs on the fly?

    Hello everyone.

    I'm trying to do something with .htaccess files, and I thought that someone here might have an idea about this.

    I have a website, currently located in the server root, which links to it's images and pages using direct URLs like /images/logo.png and /section/page.html . However, I want to move that site to a subdirectory, yet keep the links in working order without having to change them. What I would need is some sort of .htaccess file located in the site's new subdirectory that would modify the links of the page to keep them all relative to the subdirectory instead of the root. For example, links like /images/logo.png should be automatically converted by Apache to something like /old/images/logo.png (notice the added /old/ part). It's probably possible, I just don't know how (the doc on mod_rewrite is pretty dense). I don't know either if I'm clear in my explanations, so feel free to ask if you don't understand.

    Can anyone help?
    - Dr. Cossack

    Interordi.com: Internet tools, programming, games, and more!

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: htaccess to change URLs on the fly?

    Can you set up a pointer to the images (like a url redirection), then for each image it goes to that redirection first, then the slashes??

    Just a thought, not sure if its viable.

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2001
    Location
    Quebec, Canada
    Posts
    43

    Re: htaccess to change URLs on the fly?

    That wouldn't work for a reason: I have a new set of pictures that took over the the old one. Therefore, I can't put a redirection instead of that picture... Right now, the old site links to the new pictures, while I want it to still link to the old set. That's why I'm looking for another solution.
    - Dr. Cossack

    Interordi.com: Internet tools, programming, games, and more!

Posting Permissions

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



Click Here to Expand Forum to Full Width