Solved

URL links in the form "www.somesite.com/-pagename"

Posted on 2007-04-08
4
195 Views
Last Modified: 2011-09-20
I just moved a website to a new host. It contained many URL links in the form "www.somesite.com/-pagename", which the new host did not seem to understand. I converted them all to the form "www.somesite.com/pagename.html", which made the new host happy, BUT broke any external links in the "dash" form from other sites.

1. Is there anything I can change on the new host and/or new site to make the external links start working again?
2. I thought page names were REQUIRED to start with a letter -- why did the "dash" format work on the old site, and why would external sites use that format?

0
Comment
Question by:dossbob
  • 2
4 Comments
 
LVL 5

Expert Comment

by:DToolshed
ID: 18874335
What is the new webserver? Windows based? Linux based?

www.somesite.com/~pagename.html is a common format, and while I haven't seen dash used for it, it is likely that it was the same thing. It's sort of a virtual redirect. It tells the webserver to pull the page out of a users public_html folder (usually) instead of the main websites directories. There is a brief explanation of it here: http://www.webdeveloper.com/drweb/questions.html#tilde

Your current webserver would need to be setup in a similar way to provide that function. Not usually very difficult, but how you do it depends on the server, and who is doing the hosting.
0
 
LVL 8

Expert Comment

by:thur6165
ID: 18875409
What your previous host was doing i'm not sure, but what if you simply so thru and remove the - from your external links.  May be less trouble than getting your host to change the web server, they probably wont be willing to either.
0
 

Author Comment

by:dossbob
ID: 18875504
I don't have control over the external links. I happen to know of the one that was reported as broken, and will ask that webmaster to change his/her link. But there could be zero, one, or many others that I don't know about yet.

If the dash is "common" usage (like the tilde), I want to learn how to deal with it properly.

But if it's something odd about the old host, I can just ignore the potential problems until someone reports a broken link on some as-yet unknown site.
0
 
LVL 5

Accepted Solution

by:
DToolshed earned 500 total points
ID: 18903558
2 ways to deal with external link. One is wait until someone asks you about it, the other is make a page in the server to redirect to the correct page.

If the dash or tilde was used as a public_html folder redirect, then you would need to setup something like that on the new server to redirect to the correct new page. I don't know if ignoring the issue is really good, since it can frustrate end-users, who may not report the problem.

Possibly, you could add a custom 404 page with a script to grab any attempts to access a -pagename.html, strip the actual pagename out, and do a 301 redirect to that page if it exists, and give an actual 404 error page if it doesn't. This page (http://www.stevenhargrove.com/redirect-web-pages/) covers the major website server scripting languages. (PHP, ASP, CGI, etc.) This might be the best permanent solution, as any external links will still work, and it gives a subtle clue to users that they should update their bookmarks.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
http to https 3 70
Internet Explorer question 6 28
Company website 6 30
What browser will run Java? 7 56
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The viewer will learn how to dynamically set the form action using jQuery.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question