Jump to content

SubDomain + file help (PHP & MySQL / htaccess)


Jakehh

Recommended Posts

Hello,

 

I am currently hand-coding a website by myself, it requires the user to set a town and state, and with those i wish to do the following,

state.site.com/town/, and i do not wish to consume space by making multiple folders. is there a quick and easy to maintain way?

 

Thanks in advance.

Link to comment
Share on other sites

You'll need to be a little more specific with regards to "would become".

 

What address do you wish the user to type into the Address bar?

What is the address of the page you wish them to see?

Do you wish the forward to show the 'actual' link in the Address bar, or the address they typed still?

Link to comment
Share on other sites

I don't see what's so hard to explain? All I asked was where the file is stored that you wish the user to see and where you want them to think they're are actually looking at (the link in the address bar). It makes a big difference to the pattern used. If you wish the address bar to contain http://domain.com/state/town but the user to actually view http://california.some-town.domain.com then the mod_rewrite could be something as simple as...

 

RewriteRule ^([a-z]+)/([a-z]+)/?$ http://$1.$2.google.com

 

But if you want the opposite (which it sounds like you do) then it's a bit more complicated and requires your DNS supporting it. This link seems a fairly comprehensive yet simplified resource.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.