Jump to content

Recommended Posts

Posted

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?

Posted

Probably you will need to modify the .htaccess file, but as I have never done that, I'll leave it for a more experienced family member.

 

Good luck.

  • 3 weeks later...
Posted

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 ?

Posted

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 :)

Posted

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

Posted

I too am interested in how to do this. I have a subdomain gas.guitarforum.net that gets switched to guitarforum.net/gas automatically. This can cause problems with cookies.

Posted

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".

Posted

tell me,

 

by default, a subdomain has for target a subfolder with the same name. Where is this property defined ? Is it on the configurations files of the server, or Can I change it ?

Posted

Can I ask why you want the subdomain name and folder name to be different?

 

Understanding your problem, may help us to find the solution for you.

Posted

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 :)

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

×
×
  • Create New...