Jump to content
Swift

Subdomain Url

Recommended Posts

I'm setting up a subdomain for private use. I've managed to stop robots (hopefully) but have a question about the URL and the way it shows up in browsers.

 

I've set up a test subdomain called - believe it or not - test.

 

If I access that subdomain as test.swiftbooks.co.uk the URL in the browser is showing up as www.swiftbooks.co.uk/test

 

I'd prefer it to show up as test.swiftbooks.co.uk

 

How do I achieve that? Or am I just being too pedantic? ;)

Share this post


Link to post
Share on other sites
Or am I just being too pedantic?

 

Probably, but it looks like it'll work the way you want it to if you set the subdomain up in CPanel. Don't create the folder first - let CPanel do it.

Share this post


Link to post
Share on other sites

Most likely you have a redirect/rewrite rule somewhere that is causing this problem. Disable your .htaccess file and the problem should go away. Once verified, then you can sort out what in your .htaccess is causing the problem.

Share this post


Link to post
Share on other sites
Probably, but it looks like it'll work the way you want it to if you set the subdomain up in CPanel. Don't create the folder first - let CPanel do it.

I did that in the real subdomain, but when I tried to install the system it complained that the directory already existed - so I had to delete it. I guess I probably deleted the subdomain in cPanel as well.

 

I've now renamed my subdomain root, deleted and recreated the subdomain and copied the system from the renamed root into the root created by cPanel. It seems to work.

 

Is it my imagination or is the new cPanel putting subdomain root directories in a different place compared to the previous version?

Share this post


Link to post
Share on other sites

The subdomain function will create the folder if it does not exist and is the proper way to create a subdomain. If you already have a folder created, rename it, create the subdomain in cPanel, delete the folder it creates and rename the original folder.

 

No redirects necessary.

Share this post


Link to post
Share on other sites

Many thanks - problem solved by renaming the folder containing the newly implemented system, letting cPanel do all the subdomain and root folder creation, then copying the newly implemented system into the root folder created by cPanel.

 

I'm still convinced the new version of cPanel is creating the subdomain's root folder under /home/-username- whereas the previous version was defaulting to /home/-username-/public_html. However, as the subdomain is now working as I want it's not a problem. In fact, I prefer it as it causes less confusion about which folders belong to which systems!

Share this post


Link to post
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.


×
×
  • Create New...