memele
3 months ago

Is it bad practice to use absolute URL in an anchor tag?

Posted 3 months ago by memele

I am creating a website with multiple subdomains (forums). On my home view I want to list all discussions from all subdomain forums. I can't use a relative URL because I need to prefix the route with the subdomain. I found a way that works -

<a href="http://{{$discussion->forum->slug}}.frm.test/discussion/{{$discussion->id}}/{{$discussion->slug}}">{{$discussion->title}}</a>

But something about this feels wrong. Is there a better way to achieve this or is this ok?

Please sign in or create an account to participate in this conversation.