Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Not Resolving Relative File Paths In HTML After Website Copy/RestoreNot Resolving Relative File Paths In HTML After Website Copy/Restore
Previous
 
Next
New Post
12/12/2006 4:35 PM
 

There are several good posts that describe in detail how to copy a hosted DNN website to your local computer.  One of the better posts is at

http://www.dnncreative.com/Forum/tabid/88/view/topic/forumid/4/postid/1919/Default.aspx

Note that the first step in all these procedures is to go to Admin / Site Settings /Portal Aliases
and add a New HTTP Alias for the address that you wish to use for your locahost installation:

    for example, localhost/yourdirname

 The main problem with these approaches is that when the destination (copied) website is run in a development environment such as Visual Studio 2005, Visual Web Developer or even directly in IIS, all files referred by a relative path in HTML are not recognized. 

For example, assume that you want to copy a website that resides on a hosted web server to your local computer. This web server's files are stored in the /wwwroot directory on the web server and for consistency you would also copy all these files in a \wwwroot directory on your local computer. For convinience, all paths imbedded in HTML on the web server should be relative instead of absolute.  "/mypath/myfile.jpg"  would be a relative path whereas "http://mywebsite.com/mypath/myfile.jpg" is an absolute path. When testing the copied website, the easy way to check this problem is to look at your graphics files on the copied site.   If the files use relative paths, the graphics files are not displayed on any web page of the copied website.

When encoutering this error, the first place to check is the  PortalAlias.HTTPAlias column in the database.  The column should contain an entry for 

    localhost:9999/wwwroot where 9999 is the http port of the local host. 

This value is set in DNN using the Admin / Site Settings /Portal Aliases menu before the hosted web site is copied.

The next place to look would be the settings on the local web server.  From discussing this issue with other developers, the problem occurs on both the Visual Studio 2005 ASP.NET Development Web Server and IIS 6.   Both servers allow you to specify a Virtual Path and Root URL:

Virtual Path:  /wwwroot

Root URL:  http://localhost:9999/wwwroot

Changing either of these settings to Virtual Path:  / or Root URL:  http://localhost:9999/  does not resolve the problem.

At this point I am open to suggestions.

Thanks,

Stefan Pantu

Computer Software Connection, Inc.

southfloridakiteboarding.com

 
New Post
12/12/2006 5:25 PM
 
"/mypath/myfile.jpg"  would be a relative path whereas
I don't know that I can solve your problem.  But I disagree with this statement.  "/mypath/myfile.jpg" is still an absolute path, indicating that the /mypath folder will be in the website's root folder.  However, "mypath/myfile.jpg" is a relative path, indicating that the mypath folder will be a subfolder under the current page's folder.
 
New Post
12/12/2006 5:43 PM
 
JonRobertson wrote
 "/mypath/myfile.jpg"  would be a relative path whereas

I don't know that I can solve your problem.  But I disagree with this statement.  "/mypath/myfile.jpg" is still an absolute path, indicating that the /mypath folder will be in the website's root folder.  However, "mypath/myfile.jpg" is a relative path, indicating that the mypath folder will be a subfolder under the current page's folder.

I see your point.  Instead of "/mypath/myfile.jpg" I should have used ".../mypath/myfile.jpg" in the text above.

I skewed the defenition of absolute and relative paths to conform to this problem.  Any path that is not prefixed with the server name (for example, ".../mypath/myfile.jpg") breaks in the copied web site.  I called this a relative path. 

Stefan

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Not Resolving Relative File Paths In HTML After Website Copy/RestoreNot Resolving Relative File Paths In HTML After Website Copy/Restore


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out