Alias and subfolder rewrite

Discussion in 'Apache' started by aigarinsh, Feb 18, 2009.

  1. #1
    Hi I'm new to rewrites. Can somebody please help me resolve this?

    My Docroot is D:/Server/Webs/
    My site is under D:/Server/Webs/4c/Web

    I have added Alias /4c D:/Server/Webs/4c/Web
    So when I enter http://192.168.1.101:8080/4c/ site opens fine, only thing absolute URLs like /css/style.css are not working.

    .htaccess is working, but I can't figure out how should I set it that http://192.168.1.101:8080/4c/ works with absolute paths.
     
    aigarinsh, Feb 18, 2009 IP
  2. tolra

    tolra Active Member

    Messages:
    515
    Likes Received:
    36
    Best Answers:
    1
    Trophy Points:
    80
    #2
    You've configured apache so that your project is at http://192.168.1.101:8080/4c/ that is it is in the folder 4c, therefore you need to add /c4 to the start of your absolute paths e.g. /4c/css/style.css

    If you give /css/style.css then it's looking for the folder http://192.168.1.101:8080/css/

    If you want to avoid putting 4c in the path then you need to change the root to be your 4c project folder then http://192.168.1.101:8080/css/style.css will work, alternatively use relative paths.
     
    tolra, Feb 19, 2009 IP
  3. aigarinsh

    aigarinsh Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    OK, thanks, now I understand. Means I better use VHost, which I already did and everything is working fine.
     
    aigarinsh, Feb 19, 2009 IP