Web Connection
WC7 deploy install - localhost css links
Gravatar is a globally recognized avatar based on your email address. WC7 deploy install - localhost css links
  Michael Hogan (Ideate Hosting)
  All
  Dec 29, 2020 @ 01:52pm

My first serious WC7 project - it's going pretty smoothly for the most part. Very nice! A lot of improvements since 5.xx

When I first set up the live web server, I used localhost for the site location because I didn't yet set up DNS and the IIS site - but I now see (when I connect over the net) that the admin page css links point to localhost/css instead of the site url.

Example: http://localhost/lib/bootstrap/dist/css/bootstrap.min.css

How can I now correct those paths after the fact - ideally to use relative paths ???

Gravatar is a globally recognized avatar based on your email address. re: WC7 deploy install - localhost css links
  Rick Strahl
  Michael Hogan (Ideate Hosting)
  Dec 29, 2020 @ 01:59pm

The admin URL is configured in the configuration files.

What server are you using? IIS Express or the Web Connection Web Server (with .NET Core)?

in either web.config or WebConnectionWebServerSettings.xml:

<add key="AdminPage" value="~/admin/Administration.wc" />

~ automatically should translate to point whatever the current server address is (ie. localhost:5000 or localhost:7000)

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: WC7 deploy install - localhost css links
  Michael Hogan (Ideate Hosting)
  Rick Strahl
  Dec 29, 2020 @ 02:26pm

I'm using full IIS and the admin page url is fine - it's the links to supporting files within the web page that are off.

My admin web page is http://www.mysite.com/admin/Administration.wc - correct

When I 'view source' the link targets are pointing to localhost:

<link rel="shortcut icon" href="http://**localhost**/favicon.ico" type="image/x-icon" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon" href="http://**localhost**/touch-icon.png" />

<link rel="icon" href="http://**localhost**/touch-icon.png" />
<meta name="msapplication-TileImage" content="http://**localhost**/touch-icon.png">

<link href="http://**localhost**/lib/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" />
<link href="http://**localhost**/lib/fontawesome/css/all.min.css" rel="stylesheet" />
<link href="http://**localhost**/css/application.css" rel="stylesheet" />    
<script src="http://**localhost**/lib/jquery/dist/jquery.min.js"></script>
Gravatar is a globally recognized avatar based on your email address. re: WC7 deploy install - localhost css links
  Michael Hogan (Ideate Hosting)
  Michael Hogan (Ideate Hosting)
  Dec 29, 2020 @ 02:39pm

Never mind - it seems to be working now. Not sure why it wasn't working, or why it's working now...

Thanks.

Gravatar is a globally recognized avatar based on your email address. re: WC7 deploy install - localhost css links
  Rick Strahl
  Michael Hogan (Ideate Hosting)
  Dec 29, 2020 @ 04:25pm

Well aren't those server links correct anyway?

Assuming you're running out of the root site, http://localhost/lib/bootstrap/dist/css/bootstrap.min.css would be correct.

However, what might be happening is that you end up getting weird caching if you had another site running on localhost. It would then cache load old files and that might screw you up.

I do this all the time with the Web Connection Web Server when I run it local against multiple sites. When I do and just load a page on one site, then start a different site the first page that comes up if I navigate seems to run the old site - because everything comes from the browser cache - it doesn't know you've switched the site 😃.

A hard reload (Ctrl-Shift-R or Ctrl-F5) usually fixes that.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: WC7 deploy install - localhost css links
  Rick Strahl
  Michael Hogan (Ideate Hosting)
  Dec 29, 2020 @ 04:25pm

Well aren't those server links correct anyway?

Assuming you're running out of the root site, http://localhost/lib/bootstrap/dist/css/bootstrap.min.css would be correct.

However, what might be happening is that you end up getting weird caching if you had another site running on localhost. It would then cache load old files and that might screw you up.

I do this all the time with the Web Connection Web Server when I run it local against multiple sites. When I do and just load a page on one site, then start a different site the first page that comes up if I navigate seems to run the old site - because everything comes from the browser cache - it doesn't know you've switched the site 😃.

A hard reload (Ctrl-Shift-R or Ctrl-Shift-F5) usually fixes that.

+++ Rick ---

© 1996-2021