Solved

How can I set up a virtual director?

Posted on 2009-05-06
6
278 Views
Last Modified: 2012-05-06
I want to create a dynamic where a radio station can offer to their users a URL that will connect them to a page within countryshowdown.com. Ideally, I want that URL to be countryshowdown.com/WKKY. In other words, I want to know how I can set things up on my server so WKKY can plug that URL in and be redirected to a countryshowdown.com/radio_station.php?id=14. Can I do this without having to create 420 individual folders, each named after a station's call letters.

When I go out to youtube, for example, the URL is youtube.com/brucegust. I doubt they have a directory on their server entitled, "brucegust," but how are they doing it and how can I create the same kind of dynamic?
0
Comment
Question by:brucegust
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
6 Comments
 
LVL 2

Expert Comment

by:joshlunsford
ID: 24318577
This is done in apache using the alias directive.


Example - you would put this into the http.conf file
Alias /john "/path/to/john"
0
 

Author Comment

by:brucegust
ID: 24318602
I'm familiar with phpMyAdmin and I've got cpanel - where I do I go to access the alias directive?

Also, if I've got 422 stations, will have to do this 422 times?
0
 
LVL 54

Accepted Solution

by:
b0lsc0tt earned 500 total points
ID: 24400746
brucegust,

This goes into something that I haven't been able to make my expertise yet but I can try to help.  Also I will have a zone advisor move this to another zone or two to try to attact some of the experts who can help more.

This is something you will need to do in httpd.conf or maybe the .htaccess file.  However it seems like more of a mod_rewrite solution to me than Alias.  Do you have to have the id number or can the radio station letters (i.e. the part you want to show in the URL) be used.  What I mean is can the URL a person sees and types be ...

countryshowdown.com/WKKY

... while the server takes them to the file radio_station.php and uses the query string like ...

?name=WKKY

If this method is acceptable then I believe the lines below will do it.

RewriteEngine On
Rewrite Rule /(.+) /radio_station.php?name=$1

This would assume you would not have any subdirectories on the site and ever need a URL like countryshowdown.com/folder/filename.php .  If you would need something like that then you'd need to provide a condition in the rewrite so it was only used when a name was used.

Let me know if you have any questions or need more information.

b0lsc0tt
0
 

Author Comment

by:brucegust
ID: 24400919
Thanks!
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 24413744
brucegust,
Did my expert comment help?  Your response of "Thanks" wasn't real specific.
bol
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

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.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

738 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