logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: mod_rewrite - some_word.domain.com
Author
koco



Joined: 18 Jul 2006
Posts: 1

PostPosted: Tue 18 Jul '06 9:22    Post subject: mod_rewrite - some_word.domain.com Reply with quote

hey folks!

just found this forum. excellent. gone thru some materials, but didnt find or to say more precisely, I may have missed a potential solution. I have a php based web site + mysql databse with keywords and description and etc. What I want:

I have a site www.domain.com. Displays a categories and keywords which are queried from my mysql database. When you click at a specific word you get the resulting links from the a xml feed at www.domain.com/results.php?id=some_id. All results are derived from a xml feed. What I want is:
I click for example "Books", "Rare Books" or whatever keyword and to have these links respectively:
books.domain.com/...
collectorsbooks.domain.com/...
rarebooks.domain.com/...

Note:
... - Means the rest of the url.
That means I have links (and subdomains) keyword.domain.com that refer actually to domain.com/results.php?id=some_id.

Is mod_rewrite the thing to go with?

Example: www.doo.co.uk

I have wild card for subdomains. Actually each generated link will be prepended with keyword value. Because the subdomain actually it doesnt exist it will be redirect to the default url address DOMAIN.com, in this case www.domain.com. It doesnt change much. I just need simple php code to prepend word. is that correct?


Can you understand exactly what I want? Smile
Please suggest solution. I saw wide variety of text on this topic. will keep looking and on track to dive into reading url rewriting as I see and understand that is the way to go...


Thanks!

koco
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3053
Location: Hilversum, NL, EU

PostPosted: Tue 18 Jul '06 11:56    Post subject: Reply with quote

Not sure why you want to use the links this way ?

With mod_rewrite you can do it, but I am not that good in mod_rewrite.

Maybe there is an example for you at:

http://www.apachelounge.com/viewtopic.php?t=54
http://rewrite.drbacchus.com/
http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

Steffen
Back to top


Reply to topic   Topic: mod_rewrite - some_word.domain.com View previous topic :: View next topic
Post new topic   Forum Index -> Apache