how best practice setup project rakit with dynamic subdomain? #36
-
|
saya mau setup projek dimana projek tersebut memakai dynamic subdomain |
Beta Was this translation helpful? Give feedback.
Answered by
esyede
Oct 11, 2024
Replies: 2 comments 1 reply
-
|
Hello, dynamic subdomain and subdomain routing are not supported at the moment. So I'm afraid you need to do some tweaks on your RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTP_HOST} ^(www\.)?mywebsite\.com$
RewriteRule ^(.*)$ /index.php/$1 [END,QSA]
RewriteCond %{HTTP_HOST} !^www
RewriteCond %{HTTP_HOST} ^([a-z0-9-]+)\.mywebsite\.com$ [NC]
RewriteRule ^(.*)$ /index.php/users/%1/$1 [END,QSA]// routes.php
Route::get('users/(:all)', 'user@index');Note that the above snippets are untested, so you certainly need to test and adjust it yourself. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
wznuhidayat
-
|
thanks for your answer, i will try it |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, dynamic subdomain and subdomain routing are not supported at the moment. So I'm afraid you need to do some tweaks on your
.htaccessor nginx config file. Something like :RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{HTTP_HOST} ^(www\.)?mywebsite\.com$ RewriteRule ^(.*)$ /index.php/$1 [END,QSA] RewriteCond %{HTTP_HOST} !^www RewriteCond %{HTTP_HOST} ^([a-z0-9-]+)\.mywebsite\.com$ [NC] RewriteRule ^(.*)$ /index.php/users/%1/$1 [END,QSA]Note that the above snippets are untested, so you certainly need to test and adjust it yourself.