Jump to content

how to make it work subdomain with PW installed on root


fmgujju
 Share

Recommended Posts

I have installed PW on the root document and I have created subdomain which I want to run stand-alone php web application. How do I do that? what configurations needed on the PW htaccess file on the root to work my subdomain? 

Link to comment
Share on other sites

I have created subdomain which I want to run stand-alone php web application. How do I do that? 

Perhaps I misunderstood, but why not point the subdomain to a separate folder with your application in it? So the server redirects requests to this folder and PW has noting to do with it.

  • Like 1
Link to comment
Share on other sites

When I created subdomain its created folder under www folder where my PW install is. I don't know what you're proposing. If you could explain a bit then I understand.

Here is my folder structure:

www

--- cgi-bin

--- site

--- wire

--- webapp (this one is subdomain)

--- .htaccess (updated by pw during installation)

--- index.php  (created/updated by pw during installation)

When I try webapp.mydomain.com or mydomain.com/webapp then it doesn't show anything there.

Link to comment
Share on other sites

in this case, the only possible answer - as far as i my knowledge reaches - is, that /wepapp isn't the document root for your subdomain - as mademyday mentioned.

however, the most service providers allow to point a subdomain to a specific directory on your server. or in other words to make this directory/folder the default folder ("document root") for this subdomain.

note that webapp.mydomain.com is a subdomain, while mydomain.com/webapp is not.

your provider should have given you some kind of service portal, where you can order subdomains and fulfill other tasks. make sure, that your new subdomain is set to /wepapp as default folder in this portal.

  • Like 1
Link to comment
Share on other sites

@totoff is probably right and his answer makes a lot of sense in this context. Just wanted to add one slight clarification (I hope..) from my point of view:

Generally speaking it would be a very bad idea to have directory containing a subdomain inside directory containing main domain -- if we're really talking about subdomains (webapp.mydomain.com) and not directories under main domain (mydomain.com/webapp/) here, that is. That kind of setup will only result in logical (ie. what happens when you navigate to mydomain.com/webapp/) and practical (ie. running ProcessWire inside ProcessWire) problems.

A subdomain doesn't have to have anything in common with your main domain (it's another domain after all) and it's definitely nothing like a sub directory, which is your current setup seems pretty messed up to me. If possible, something like this would seem better option:

/www/mydomain.com/

/www/webapp.mydomain.com/

.. or perhaps this, which is what one webhost I'm using does (though I've no idea why):

/mydomain.com/www/

/webapp.mydomain.com/www/

  • Like 2
Link to comment
Share on other sites

Thank you MadeMyDay and totoff for your reply.

I used CPanel to create subdomain and it create folder under public_html.

public_html

--- cgi-bin

--- webapp (this one is subdomain)

------ .htaccess (updated by pw during installation)

------ index.php  (created/updated by pw during installation)

--- site

--- wire

--- .htaccess (updated by pw during installation)

--- index.php  (created/updated by pw during installation)

 

If anyone can tell me where to go and how to do it that would be much appreciated. 

 

Ok. I figured out how to do it. Thank you everyone!

Link to comment
Share on other sites

public_html
--- cgi-bin
--- webapp (this one is subdomain)
------ .htaccess (updated by pw during installation)
------ index.php  (created/updated by pw during installation)
--- site
--- wire
--- .htaccess (updated by pw during installation)
--- index.php  (created/updated by pw during installation)

@fmgujju great to hear you got it working, but your configuration seems wrong to me. i understood you want to run a separate php application under /webapp, that is not a pw install. in this case your /webapp/index.php and /wepapp/.htaccess files shouldn't belong to pw but should be replaced by dedicated files of the application.

@teppo your are definitely right, but unfortunately some isp doesn't allow for such a folder structure. this weekend i had to deal with a client's account at isp hetzner and they demand for precisely the same structure fmgujju has: primary domain point to /public_html and all subdomains point to dedicated directories within /public_html. don't know why they demand for this, but you don't have a choice.

  • Like 1
Link to comment
Share on other sites

@totoff I have do not have more control than what control panel allows me to do it. I think I can still move subdomain folder from public_html and point subdomain to that folder. I will test it out when I get chance. I don't have much time to finish my webapp so I need to concentrate on that first.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...