SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2011
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Folder-specific RewriteRule

    Hello,

    I'm trying to accomplish the following.

    I have a .htaccess file that looks like this:
    Code:
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?request=$1 [L,QSA]
    But I need something else and I can't seem to find the solution.

    I have to folders in my root directory; public and mvc, where mvc contains a framework.
    public will contain images/javascript and css files in the folders img, js and css.

    I want to be able to use the tag
    HTML Code:
    <img src="public/images/test.png">
    .
    This works fine if I'm at the homepage http://domain/ but when I'm at http://domain/test/ it doesn't.

    I want this to work for everything that must come from within the public folder.
    (only files, no directories, so I can still use http://domain/public/ as an address)

    Thank you very much in advance,
    xtaste

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,645
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    xt,

    What you're referring to is using the same relative link from different directory levels. You can't get there from here. For what you're asking, you need to change your link to an absolute link (either external with http://yadda-yadda or internal with /yadda).

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2011
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks DK for your reply.

    I get it, was hoping it would work

    Greetings,
    xtaste


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
  •