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
Solved

How can I set up a virtual director?

Posted on 2009-05-06
6
269 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
  • 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

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…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

860 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