ebookx10
New Member
- Messages
- 7
- Reaction score
- 0
- Points
- 1
I want to test using Laravel, but it does not work correctly.
My goal is to add a subdomain laravel to [mysite].x10.mx
I upload laravel directory (from a fresh install) to my server, and it looks like this:
Then, I create a subdomain from CPanel:
I create 2 route from my laravel app:
And this is a result (Case 1):
So, the route laravel.[mysite].x10.mx/test does not work here
I make a small change:
- Move and rename HOME/laravel/public to HOME/public_html/public_laravel
- Change some reference in public_laravel/index.php:
- Change document root for the subdomain to HOME/public_html/public_laravel
- New site structure:
Finally, it works (Case 2):
I can make it work, but I still don't know why in Case 1, the second route to "/test" lead into error
First, I think that the document root folder of subdomain must be inside the main document root (HOME/public_html), but the first route to "/" in Case 1 still works, so this is not the cause of the error
So, what is the different between inside and outside HOME/public_html that make Case 1 differ from Case 2? Is mod_rewrite module doesn't apply to outside this folder?
Can I make Case 1 work like Case 2?
(Sorry for my poor English)
My goal is to add a subdomain laravel to [mysite].x10.mx
I upload laravel directory (from a fresh install) to my server, and it looks like this:
Then, I create a subdomain from CPanel:
I create 2 route from my laravel app:
PHP:
// app/Http/routes.php
Route::get('/', function () {
return "Home Page";
});
Route::get('test', function () {
return "Test Page";
});
And this is a result (Case 1):
So, the route laravel.[mysite].x10.mx/test does not work here
I make a small change:
- Move and rename HOME/laravel/public to HOME/public_html/public_laravel
- Change some reference in public_laravel/index.php:
PHP:
require __DIR__.'/../../laravel/bootstrap/autoload.php';
$app = require_once __DIR__.'/../../laravel/bootstrap/app.php';
- New site structure:
Finally, it works (Case 2):
I can make it work, but I still don't know why in Case 1, the second route to "/test" lead into error
First, I think that the document root folder of subdomain must be inside the main document root (HOME/public_html), but the first route to "/" in Case 1 still works, so this is not the cause of the error
So, what is the different between inside and outside HOME/public_html that make Case 1 differ from Case 2? Is mod_rewrite module doesn't apply to outside this folder?
Can I make Case 1 work like Case 2?
(Sorry for my poor English)
Last edited: