views:

16

answers:

2

I apologize if this is a basic question, however I have been searching on this and can't find anything of use, probably since I don't really know the proper terms.. I am wondering if there is a way to interpret the url that is called on the server, such as:

http://mydomainname.com/site1/module1

and then using PHP (ideally), or some other technology if necessary, change the display of the url to the use as something else, such as:

http://domainname.com/app1

I realize I would have to put in specific things to change urls to and from, just am not sure if this is possible.. thanks for any advice.

+2  A: 

You are looking for information on URL rewriting. Since you are using Apache, the mod_rewrite module is probably what you are most interested in. Unfortunately, I'm not that familiar on the topic and frequently have to consult guide myself. But at least you have some reading material until someone with more knowledge in this area can help you.

Thomas Owens
thanks.. ok so thats the term I am looking for, will check into that
Rick
If no one answer this specific question, at least you have something to work with to either try to figure it out on your own, edit this question, or ask a new question using knowledge you've gained from the links I've provided and your own searches. Good luck!
Thomas Owens
thanks, I agree.. thats what this site is great for.. getting pointed in the right direction
Rick
+1  A: 

An .htaccess file like this works:

Options +FollowSymLinks
RewriteBase /
RewriteEngine On
RewriteRule \.(css|js|png|gif|jpg|xml|txt|zip|rar|swf|flv|as|ico|csv|xls|php|pdf|html)$ - [S=1]
RewriteRule .* index.php [L,NC]

Your index.php file will need to handle the routing of the page from there. It's a good place to start for those with custom content management systems.

Mitch C
ok, so you can only re-route to the index.php? What would I use to re-route within the index.php? (just basic terms so I can search on it).. thanks
Rick
I created a script that processes the $_SERVER['QUERY_STRING'] to determine where to go. IE: yourdomain.com/PageToPointTO/actionToTakeMy parsing script actually looks for variables as well, /var,1/var,2 and merges it into a global input variable that gets cleaned for universal sanitation.
Mitch C