Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

programmer_110's avatar

Locale prefix in Inertia Link href

Hi,

I would like to add my current locale prefix in a generic way in order to avoid redirection from middleware for every request

0 likes
3 replies
Freyasavage's avatar

Hello, Determine your local prefix: Identify the local prefix or base URL that you want to add to your requests. For example, it could be something like "http://localhost:3000" or "https://example.com".

Configure your application: Depending on your programming language or framework, look for configuration files or settings where you can define the base URL or local prefix. This could be a configuration file specific to your application or a configuration option provided by the framework you're using.

Set the base URL or local prefix: Update the configuration with the local prefix you identified in step 1. Make sure to set it in a generic way so that it applies to all requests made by your application.

Utilize the base URL or local prefix: When making requests within your application's code, instead of hardcoding the full URLs, use relative URLs that assume the base URL or local prefix is already included. This way, your application will automatically prepend the local prefix to each request, avoiding the need for redirection from middleware. https://www.mybkexperience.one/

helluty23's avatar

Determine your current local prefix: The local prefix refers to the part of the URL that indicates the root of your application or API. For example, if your application is hosted at then the local prefix would be /myapp/. Modify your middleware or routing configuration: In your middleware or routing configuration, you need to check if the incoming request URL starts with the local prefix. If it doesn't, you can redirect or handle the request accordingly. https://www.prepaidgiftbalance.vip/

Please or to participate in this conversation.