Do you really need the subdomain called "sub" in the url? Maybe that's causing problems?
Just a quick tip on class naming: Don't use underscores for class names.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi, I apologize for being a rookie. This is my first time using frameworks and I chose Laravel.
installed the composer and created my first project as per the docs http://laravel.com/docs/5.1/installation
when I go to https://sub.example.com/dev/public. As I should, I get this message "Laravel 5"
However, I added the following route to my routes.php file
Route::get('authors', array('as' => 'authors', 'uses' => 'Authors_Controller@getIndex') );
Then created a new controller called Authors_Controller. and here is my controller code
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
class Authors_Controller extends Controller
{
//
public function getIndex(){
return view('authors.index')->withName('Mike A');
}
}
finally I created a new veiw called "index" (i.e. index.blade.php file) inside a folder called "authors" to look like this and here is my view's code hello {{ $name }}
However, I keep getting 404 error when I got to https://sub.example.com/dev/public/authors
What I could be doing wrong?
Yes, the mod_rewrite is enabled.
Did you enable AllowOverride for your DocumentRoot? If you don't do that, then .htaccess has no effect on mod_rewrite.
Not sure what OS you are running but on a standard Ubuntu box the settings are something like below:
/etc/apache2/sites-available/yoursite.conf
<VirtualHost *:80>
ServerAdmin youremail@yahoo.com
ServerName yoursite.com
ServerAlias www.yoursite.com
DocumentRoot "/var/www/yoursite.com/public"
<Directory /var/www/yoursite.com/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
Please or to participate in this conversation.