Jump to content

Subdomain Question


Recommended Posts

I'm looking for a way to point a subdomain at my root public_html directory but still keep the subdomain in the url. For example: I want mobile.**** to pull it's content from www.****. A redirect doesn't work because it changes the url. Any ideas?

Link to comment
Share on other sites

  • 3 weeks later...

hi

 

thank you for your answer,

 

it's a solution, but the frames are not to the w3c standards, and I have to respect these norms .. :)

I asked to your technical support, and they said me I could use the url rewriting .. What do you think about this proposition ?

Link to comment
Share on other sites

Hi,

 

If I understand you correctly, that you just want to host the sub.domain.com rather than domain.com - then simply get us to change the domain name associated with yout account to sub.domain.com.

 

Either that, or I have completely missed what you want to do :)

Link to comment
Share on other sites

hello

 

no I don't want that !

My website is a portal, I have several sections. I want Each section is asssociated with a subdomain.

For a technical reason, I use only one index(.php) for all the sections.

To define which section this index has to show, I use a variable in the url (index.php?section=example).

To conserve the value of this variable, I'd like to use the subdomains, it would be better.

So, each subdomain has to point at a url, composed by of course the index.php of the root, and the definition of the variable :

For the example, the section "ogame" has to point at "index.php?section=ogame"

I can't use any simple redirection as after the redirection, I obtain the redirected url in my url, and no more the subdomain (so the variable is not defined any more)

 

I hope you'll understand me

 

thank you ahead

 

Patami

Link to comment
Share on other sites

If your subdomain is switching in the address bar then you didn't set up the subdomain correctly.

 

When you create a subdomain it creates the folder for you. If you created the folder and then added a subdomain and told it to use the folder you created this is what happens.

 

Rename your "gas" folder something else in File Manager. Delete the subdomain you created. Then create the subdomain over again using "gas" for the sub name. It will create a new "gas" folder. Now delete the new folder and rename your original floder back to "gas".

Link to comment
Share on other sites

of course you can :)

 

I use only one index.php (at the root of my ftp). You know that with PHP, a page can change according to a variable (in the url in my case).

It's very easier for me to manage a website with several sections who has only one index.php !

So, to choose the section that the index.php has to show, I have to define the variable "section" in the url

example : index.php?section=my_section

 

For this, there is no problem. Once it's defined by the url, I save the name of the section in a session variable, to keep the choice.

If the member of my website comes at the homepage, selects the section and defines it, ok there is no problem. But if he adds a page in his favorites, and if he comes later on the same page.

For his first visit, he had defined the section in the url, and this definition had been saved with the sessions. But when he adds the page in his favorites, the session variable is not saved. So, when he comes back later, as the session variable is lost, the section is not defined, and the index.php doesn't show the good page !

 

To correct the problem, I think I can use the subdomains. So the section is always defined in the url :)

Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

 Share

×
×
  • Create New...