简体   繁体   中英

CSS and JS not loading after transferring site

I initially developed my app on IIS and I am now moving back to Apache.

I have copied the whole application directory onto a new Ubuntu 14.04 LAMP server. I am running my app as a virtual directory so that I can have multiple sites.

I have deleted the web.config files and updated the .htaccess files and I have the home.ctp page loading. I have tried to load one of my index views and it starts loading the page but the CSS and Javascript don't load.

In the webroot/index.php I found and updated the "CAKE_CORE_INCLUDE_PATH" which was hard coded to the Windows drive.

I have my app under /usr/share/SRP and I have a SRP.conf to give me a url of http://server.com/SRP/

Alias /SRP /usr/share/SRP

<Directory /usr/share/SRP>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    DirectoryIndex index.php
        Order Allow,Deny
        Allow from All
</Directory>

When I try to access another page, eg http://server.com/SRP/users , the page loads without the CSS and Javascript.

<script type="text/javascript" src="/SRP/js/jquery-1.10.2.min.js">

In this case the javascript doesn't load (gets a 404).

<img src="/SRP/img/cake.power.gif" alt="Systems Management Request Portal" border="0" />

It seesm strange to me that the cake gif does load. So does DebugKit and toolbar.

I think this a problem with mod_rewrite or WEBROOT_DIR.

I had to copy the js, css and img files from SRP/app/webroot to SRP/webroot. I don't understand why changing web servers caused this change.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM