PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Blocks

    Design blocks for your website

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

Question By
Unsolved
freeadsy

May 2nd, 2023 02:05 PM

how user make subdomain when register and how user add domain to redirect to his subdomain like shopifay laravel tutorial

bobbyiliev

May 3rd, 2023 12:12 PM

Hi there,

Can you share a bit more information about your exact use-case? Are you building a new app with Django and you want to allow users to use their own domains?

The way I would tackle this is to begin by guiding your users to establish the correct DNS record, directing their domain to your own (most likely a CNAME).

Next, adjust the ALLOWED_HOSTS parameter in your settings.py file to a wildcard (*), which is allowed. Be cautious, though, as this setup can introduce a security risk, so it's advisable to incorporate your own host verification, preferably at the middleware stage as per Django's recommendation.

Lastly, make changes to the method employed for displaying a user's page. Rather than matching the subdomain, match the complete domain.

With Laravel you can do this with the Route::domain method:

Subdomain Routing

Best,

Bobby

freeadsy

May 4th, 2023 06:03 PM

yes i make a project , i want when user register new account creat his own domain and user can direct his custom domain like www.userdomain.com to user.laravelproject.com

i need tutorial or explain with code

thanks