oshopindia Posted September 16, 2013 Share Posted September 16, 2013 I'm trying to display products specific to a geographic location on the website. E.g. If a user selects city1 then my website url should change to city1.mysite.com. So the city1 part is dynamic on user selection. Please let me know how this is to be achieved and if this includes mod-rewrite or subdomains for each location. Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/282187-mod_rewrite-with-subdomain/ Share on other sites More sharing options...
requinix Posted September 16, 2013 Share Posted September 16, 2013 What's the meaning behind the city? Is it like Craigslist where there's different content for each city? Quote Link to comment https://forums.phpfreaks.com/topic/282187-mod_rewrite-with-subdomain/#findComment-1449750 Share on other sites More sharing options...
oshopindia Posted September 17, 2013 Author Share Posted September 17, 2013 Yes, exactly the same concept, there maybe buyers and sellers in each city. Users would get personalized content from the city they select(that's the easy part ). So the url should change according to their selection. There are other website examples too like olx.in and quikr.com Quote Link to comment https://forums.phpfreaks.com/topic/282187-mod_rewrite-with-subdomain/#findComment-1449803 Share on other sites More sharing options...
requinix Posted September 17, 2013 Share Posted September 17, 2013 Well, basically, you set up your virtualhost to use *.example.com as the domain, then your PHP scripts can look at the HTTP_HOST (the subdomain specifically) to decide the city. Don't actually need URL rewriting for it. So what are you going to do about the 49 different Greenvilles? 29 Springfields? 18 Clevelands? Quote Link to comment https://forums.phpfreaks.com/topic/282187-mod_rewrite-with-subdomain/#findComment-1449806 Share on other sites More sharing options...
oshopindia Posted September 17, 2013 Author Share Posted September 17, 2013 Here the problem with places with same names is much less, so that's okay. Thanks, I'll try this. Quote Link to comment https://forums.phpfreaks.com/topic/282187-mod_rewrite-with-subdomain/#findComment-1449811 Share on other sites More sharing options...
oshopindia Posted October 10, 2013 Author Share Posted October 10, 2013 Can This done by wildcard domain Quote Link to comment https://forums.phpfreaks.com/topic/282187-mod_rewrite-with-subdomain/#findComment-1453379 Share on other sites More sharing options...
requinix Posted October 10, 2013 Share Posted October 10, 2013 That would be exactly what I said to use. Quote Link to comment https://forums.phpfreaks.com/topic/282187-mod_rewrite-with-subdomain/#findComment-1453386 Share on other sites More sharing options...
oshopindia Posted October 10, 2013 Author Share Posted October 10, 2013 Ok I created One Sub Domain Named "*" Now I What to Do For Make city wise Sub domain of it. My Site Name Is LenaBechna.com And I Hosted My website on Godaddy Now, What i Have to Write on .htaccess or other page Quote Link to comment https://forums.phpfreaks.com/topic/282187-mod_rewrite-with-subdomain/#findComment-1453389 Share on other sites More sharing options...
oshopindia Posted October 10, 2013 Author Share Posted October 10, 2013 Sir When I Going to make subdomain Named * It showing Error That Subdomain only contains character or Numbers Quote Link to comment https://forums.phpfreaks.com/topic/282187-mod_rewrite-with-subdomain/#findComment-1453404 Share on other sites More sharing options...
requinix Posted October 10, 2013 Share Posted October 10, 2013 Where are you doing this? Quote Link to comment https://forums.phpfreaks.com/topic/282187-mod_rewrite-with-subdomain/#findComment-1453475 Share on other sites More sharing options...
oshopindia Posted October 11, 2013 Author Share Posted October 11, 2013 I am Doing This in creating subdomain option Quote Link to comment https://forums.phpfreaks.com/topic/282187-mod_rewrite-with-subdomain/#findComment-1453506 Share on other sites More sharing options...
jazzman1 Posted October 13, 2013 Share Posted October 13, 2013 Well, basically, you set up your virtualhost to use *.example.com as the domain @oshopindia, do you have any idea what requinix means by saying this? " *.example.com " is not a real sub-domain. It's a pattern. Don't try to create something like that. Quote Link to comment https://forums.phpfreaks.com/topic/282187-mod_rewrite-with-subdomain/#findComment-1453712 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.