Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a URL that a lot of people need to get to on my website, but it is really long (i.e., "http://www.blah.com/blahbalk/kajsdlfja/asdafs/qwer/blah.etc - you get the idea). I want to take that URL and create an alias so if I type in 'http://www.blah.com/blah2' it will take me to the long website listed above. How do I do this? I'm pretty sure I just have to edit some stuff in httpd.conf. I did a search on this site and on the web but can't really come up with what I need. And 'yes', I'm a Linux newbie. Thanks.
if you just want one file to point to somewhere else, then i'd say avoid direct apache modifications... it seems like it's just the wrong scope you'd be working in. entire sites, yes change apache, but for a single file, sort it at a file level i'd say... just create a simple html file containing a 302 meta refresh...
Code:
<HTML>
<HEAD>
<META HTTP-EQUIV="refresh" content="2;URL="http://www.blah.com/blahbalk/kajsdlfja/asdafs/qwer/blah.etc">
<TITLE>Redirecting</TITLE>
</HEAD>
<BODY>
Redirecting you to that funky file...
</BODY>
</HTML
if you just want one file to point to somewhere else, then i'd say avoid direct apache modifications... it seems like it's just the wrong scope you'd be working in. entire sites, yes change apache, but for a single file, sort it at a file level i'd say... just create a simple html file containing a 302 meta refresh...
Code:
<HTML>
<HEAD>
<META HTTP-EQUIV="refresh" content="2;URL="http://www.blah.com/blahbalk/kajsdlfja/asdafs/qwer/blah.etc">
<TITLE>Redirecting</TITLE>
</HEAD>
<BODY>
Redirecting you to that funky file...
</BODY>
</HTML
Can you give me a little more detail? The site that is going to be redirected will have many pages, so it's not just one page that's being directed. Thanks.
Just to give a bit more detail. The site that we want to alias has many pages. The main page has 9 internal links and each of those links have many other internal links, so we're looking at about 50 pages or so that make up the site.
For one thing, the main site that we want to alias is already a sub-site of another site. So the website is like http://www.blah.com, but the site we want to re-direct's main page is like 'http://www.blah.com/career_managemnent/intern_program'. There are 9 links on this page and then many other links below that. Is aliasing even convenient? Would I have to re-direct each link after 'intern_program'?
right ok, your intital example read like it was just one common file. ok, so contrary to the above, an alias command would probably be what you want if it's actually just lower down in the site (not sure i really see a motivation for the entire side myself, user clicks a link which just happens to have a long url... so what?) so in the virtualhost or such, "alias /shortsite /var/www/html/1/2/3/4/5/". note that the second path is a filesystem path though, not a relative web page. also could you not just do a symlink outside of apache altogether??
Last edited by acid_kewpie; 01-14-2008 at 08:58 AM.
right ok, your intital example read like it was just one common file. ok, so contrary to the above, an alias command would probably be what you want if it's actually just lower down in the site (not sure i really see a motivation for the entire side myself, user clicks a link which just happens to have a long url... so what?) so in the virtualhost or such, "alias /shortsite /var/www/html/1/2/3/4/5/". note that the second path is a filesystem path though, not a relative web page. also could you not just do a symlink outside of apache altogether??
Hey, Acid_kewpie, I really appreciate the help you're trying to give me, but I am a newbie with Linux and webhosting stuff in general, so I am having some trouble understanding your post.
I see what you're saying about why alias the entire site and instead just do the main page. That's a good point, so what I'll probably do is alias the first page and then see how that goes and then make any changes later if need be.
We are running Apache 1.something, MySQL, PHP and ez publish software on a Windows 2000 Server box. Where exactly would I put that
"alias /shortsite /var/www/html/1/2/3/4/5/" line? What file would I edit? And what do you mean by "do a symlink outside of apache altogether"? Thanks.
if you just want one file to point to somewhere else, then i'd say avoid direct apache modifications... it seems like it's just the wrong scope you'd be working in. entire sites, yes change apache, but for a single file, sort it at a file level i'd say... just create a simple html file containing a 302 meta refresh...
Code:
<HTML>
<HEAD>
<META HTTP-EQUIV="refresh" content="2;URL="http://www.blah.com/blahbalk/kajsdlfja/asdafs/qwer/blah.etc">
<TITLE>Redirecting</TITLE>
</HEAD>
<BODY>
Redirecting you to that funky file...
</BODY>
</HTML
Acid,
I found out that, in fact, it is only one page that needs to be redirected. So just to be sure, I'd write an HTML file that looks like this:
Code:
<HTML>
<HEAD>
<META HTTP-EQUIV="refresh" content="2;URL="http://www.blah.com/blahbalk/kajsdlfja/asdafs/qwer/blah.etc">
<TITLE>Redirecting</TITLE>
</HEAD>
<BODY>
Redirecting you to that funky file... <- what exactly do I put here?
</BODY>
</HTML
[/QUOTE]
And where do I put this html file once it's created? Thanks.
you put that file wherever you want, just somewhere reachable over apache like any other web file. as for the body, whatever you want, just a message to the end user. you could reduce the timeout from 2 to 0 to redirect instantly too.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.