locked
blog engine RRS feed

  • Question

  • User-931073460 posted

    I'm trying to create a blog system to allow users create their own blog. In this project I need to create a subdomain for each blog dynamically. I mean when the user register his/her blog name as "shopping" he can route to shooping.domain.com and see his post.

    I will use single controller to display each blog content by subdomain name. my big problem is subdomain routing dynamically.

    Thanks in advance.

    Friday, January 22, 2021 9:37 PM

All replies

  • User475983607 posted

    A sub domain is separate application.  Routing occurs while browsing within a sub domain.  It seems like you might not understand what a sub domain is or may you mean an Area or URL?

    Friday, January 22, 2021 9:57 PM
  • User-931073460 posted

    I know subdomain is a separate application and I've already used Area.

    I need to route a controller as subdomain. for example mysite.com/realstate => realstate.mysite.com

    Friday, January 22, 2021 10:04 PM
  • User475983607 posted

    I need to route a controller as subdomain. for example mysite.com/realstate => realstate.mysite.com

    If you are creating sub domains, why is the user going to mysite.com/realstate in the first place?   You should provide the user their sub domain when the account/blog is created.  If you have a central login, then just redirect the user to their blog.  

    Friday, January 22, 2021 10:12 PM
  • User-931073460 posted

    I dont want to create a subdomain for each user, I want set a subdomain for each user name dynamically

    Friday, January 22, 2021 10:14 PM
  • User475983607 posted

    Nowbakht

    I dont want to create a subdomain for each user, I want set a subdomain for each user name dynamically

    Yeah, I'm pretty sure you have no idea what you're doing.  Sub domains are actual applications with DNS entries so the browser can get to the domain.  First, a new application is created for the sub domain.  Next, DNS is configured so the sub domain resolves to the application on the host.  DNS can take several hours to propagate through the Internet.

    The other odd requirement is routing.  You cannot route to another application.  You can only route within an application. 

    Anyway, that's why I mentioned user login.  I assumed a user wants to create a new blog.  They go to a form and input the blog information then click create.  The code creates a new hosted application and registers a new DNS entry for the blog.  You give the user the blog sub domain and tell the user to check the sub domain but it could take several hours before the DNS resolves.

    Friday, January 22, 2021 10:44 PM
  • User-931073460 posted

    Yes I will do the same thing as you mentioned. but as you saw in blogging systems when the user creates his blog. he access immediately to this.

    but as you said if I try to create subdomain it takes several hours

    Saturday, January 23, 2021 11:39 AM
  • User475983607 posted

    Yes I will do the same thing as you mentioned. but as you saw in blogging systems when the user creates his blog. he access immediately to this.

    but as you said if I try to create subdomain it takes several hours

    I'm not sure if you are asking a question, making a statement, or realizing the bugs in your design.   Keep in mind sub domain is one of the problems.   You cannot route to a sub domain.  A sub domain is a separate application by definition.

    Saturday, January 23, 2021 12:49 PM
  • User-474980206 posted

    there is nothing you can about it taking hours to add a domain to the internet. typically you supply both urs

         myblogsite.com/<bloggername>
         <bloggername>/myblogsite.com

    this allows access before the DNS change propagates thru the internet. you just use url rewrite to convert the hostheader prefix to to the route parameter. then the routes are:

        {blogger}/{controller}/{action}

     

    Saturday, January 23, 2021 6:01 PM