Reputation: 513
I have hosted a website on godaddy(economy shared hosting).This is the the first time I'm hosting one.
As it had php 5.4 so I couldn't install laravel 5 hence I have to go for laravel 4.2 which did got installed properly inside the folder akshay in root directory.
Now I moved the contents of my public folder(css js index.php all) into public_html which seems to be the public directory for the godaddy hosting.
Now I changed some paths in paths.php and index.php inside public_html folder.
paths.php
'app' => __DIR__.'/../app',
'public' => __DIR__.'/../../public_html',
'base' => __DIR__.'/..',
'storage' => __DIR__.'/../app/storage'
paths.php I also tried out this alternative
'app' => __DIR__.'/../../akshay/app',
'public' => __DIR__.'/../../public_html',
'base' => __DIR__.'/..',
'storage' => __DIR__.'/../../akshay/app/storage'
index.php
require __DIR__.'/../akshay/bootstrap/autoload.php';
$app = require_once __DIR__.'/../akshay/bootstrap/start.php';
routes.php
Route::get('/', function()
{
return View::make('index');
});
Route::get('/contact', function()
{
return View::make('contact');
});
I have two files in app/views/ --- index.php and contact.php
Now when I'm opening my site's main domain(mysite.com) it's opening well i.e the routes.php is directing it properly to index.php inside my views folder but when I'm opening any subdomain like mysite.com/contact then it is not directing to contact.php rather showing 404 error.
Then I went to subdomain section in my goddady cpanel hosting and added the subdomain mysite.com/contact.It created a contact folder inside public_html. And now mysite.com/contact shows a 403 error.
Whatever I have worked before this was only in localhost where php artisan serve made everything fine.Now in actual server it's causing problems and since i'm not able to get properly how it works I'm not able to solve the problems by myself.
Upvotes: 0
Views: 667
Reputation: 550
I'm not sure what webserver is used at GoDaddy, but are you sure that problem is with routes? If Apache is used, maybe you have forgot to upload .htaccess file with rewrite rules?
Upvotes: 2