Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Apache Help Needed

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming
View previous topic :: View next topic  
Author Message
OnlyTheTony
LXF regular


Joined: Mon Jan 08, 2007 11:51 am
Posts: 303

PostPosted: Thu Mar 18, 2010 10:14 am    Post subject: Apache Help Needed Reply with quote

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=micrositename&page=products.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
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
bobthebob1234
LXF regular


Joined: Thu Jan 03, 2008 9:38 pm
Posts: 1368
Location: A hole in a field

PostPosted: Thu Mar 18, 2010 10:24 am    Post subject: Reply with quote

Couldn't you just create a php script with
Code:

header("Location:http://mywebsite.com/$_GET['site']");

?

Edit
alternatively have you looked here
http://www.workingwith.me.uk/blog/software/open_source/apache/mod_rewriting_an_entire_site

(more help http://www.workingwith.me.uk/articles/scripting/mod_rewrite
_________________
For certain you have to be lost to find the places that can't be found. Elseways, everyone would know where it was
Back to top
View user's profile Send private message
OnlyTheTony
LXF regular


Joined: Mon Jan 08, 2007 11:51 am
Posts: 303

PostPosted: Thu Mar 18, 2010 2:15 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
bobthebob1234
LXF regular


Joined: Thu Jan 03, 2008 9:38 pm
Posts: 1368
Location: A hole in a field

PostPosted: Thu Mar 18, 2010 7:15 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast