Reputation: 325
Route::group(array('domain' => 'api.domain.com'), function()
{
Route::get('/','TwitterController@index');
Route::get('/gettweets','TwitterController@getTweets');
Route::get('/viewtweets','TwitterController@viewTweets');
Route::get('/viewvideos','TwitterController@viewVideos');
});
This is my routes.php
I am calling this /gettweets
route but it says /gettweets
is not found on server. Using godaddy linux shared.
I am only able to call /
requests.
How can I make laravel read this routes.
Upvotes: 9
Views: 4966
Reputation: 1704
Mod_rewrite must be enabled on your server. Check this post
Check you .htaccess file in public folder (which your domain pointed to) and it should contain below
Options -MultiViews
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
Create a .htaccess
file under the public directory if it does not exists.
If this does not work leave a comment.
Upvotes: 4
Reputation: 137
You need to specify godaddy to read wildcards in a way that any subdomain points to the same point. Doing that you will manage subdomains with your laravel app
https://mx.godaddy.com/help/setting-up-wildcard-dns-3301
Upvotes: -1