Re: pathing to assets not working using rewrite

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



thank you, i figured it out.  I had enabled the module overall but did not having it running for the directory.

On Mon, Feb 25, 2013 at 7:56 PM, Ben Johnson <ben@xxxxxxxxxxxxxxxx> wrote:


On 2/24/2013 7:39 PM, Matthew Smith wrote:
> I am trying to serve a secondary site from a subdirectory on my local
> server.
>
> Here is my htaccess:
>
> RewriteCond %{HTTP_HOST} mysitedotcom [NC]
> RewriteCond %{REQUEST_URI} !^/site_mysite_com/ [NC]
> RewriteRule (.*) /site_mysite_com/$1 [L]
>
> RewriteCond %{REQUEST_URI} ^/site_mysite_com/ [NC]
> RewriteCond %{HTTP_HOST} !mysitedotcom [NC]
> RewriteRule . http://%{HTTP_HOST}/ [R=301,L]
>
> The page is coming up, but assets like the css and images are not
> working when they were before(this is a fresh install of apache).
>
> so I cannot get this to load in the html:
> /css/style.css
>
> but this works:
> /site_mysite_com/css/style.css
>
> Any ideas what I am doing wrong?  I thought the point of the rewrite was
> to redirect requests to the proper subdirectory.  I'm not sure if my
> htaccess is correct; I used my host's generator for it.  It is working
> on the live site.
>
> Thank you.
>

Are you trying to set this up on a server that you control completely
(e.g., your home desktop computer)? Or on an off-the-shelf hosted
solution of some kind (e.g., the "live site" you mentioned)?

Because to what degree you have control over the Apache configuration
dictates the approach you should take.

-Ben

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




--
Regards,
chedder is bedder


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux