Apache Help Needed

Code junkies hangout here

Moderators: ChrisThornett, LXF moderators

Apache Help Needed

Postby OnlyTheTony » Thu Mar 18, 2010 10:14 am

I'm in the process of creating a website that will allow users to create/host their own microsites to sell their product.

What I need is an apache mod_rewrite config that will do the following:

Change http://mywebsite.com/sites.php?site=micrositename into http://mywebsite.com/micrositename so that entering the first URL gives you the second and entering the second URL takes you to the correct microsite.

It will also have to handle querystrings, such as http://mywebsite.com/sites.php?site=mic ... oducts.php - which would display the "products.php" page of the microsite (although that is handled using cURL and various cookies).

Any ideas?
If at first you don't succeed, call it v1.0
User avatar
OnlyTheTony
LXF regular
 
Posts: 303
Joined: Mon Jan 08, 2007 11:51 am

Postby bobthebob1234 » Thu Mar 18, 2010 10:24 am

Couldn't you just create a php script with
Code: Select all
header("Location:http://mywebsite.com/$_GET['site']");

?

Edit
alternatively have you looked here
http://www.workingwith.me.uk/blog/softw ... ntire_site

(more help http://www.workingwith.me.uk/articles/s ... od_rewrite
For certain you have to be lost to find the places that can't be found. Elseways, everyone would know where it was
User avatar
bobthebob1234
LXF regular
 
Posts: 1373
Joined: Thu Jan 03, 2008 9:38 pm
Location: A hole in a field

Postby OnlyTheTony » Thu Mar 18, 2010 2:15 pm

Bob,

Cheers for that - been googling like mad for a solution but never came across that one!
If at first you don't succeed, call it v1.0
User avatar
OnlyTheTony
LXF regular
 
Posts: 303
Joined: Mon Jan 08, 2007 11:51 am

Postby bobthebob1234 » Thu Mar 18, 2010 7:15 pm

the wonders of google!
For certain you have to be lost to find the places that can't be found. Elseways, everyone would know where it was
User avatar
bobthebob1234
LXF regular
 
Posts: 1373
Joined: Thu Jan 03, 2008 9:38 pm
Location: A hole in a field


Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest