Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How can I set up a virtual director?

Posted on 2009-05-06
6
Medium Priority
?
283 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 2000 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

721 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