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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With