9
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.

7
  • Can you tell if it was Laravel which returned the error or was it a generic Apache one? Commented Dec 7, 2016 at 17:38
  • apache is returning this error Commented Dec 7, 2016 at 17:42
  • do i have to modify the htaccess Commented Dec 7, 2016 at 17:43
  • Yeah this would happen if you didn't have the correct htaccess. Most specifically I think it would be the MultiViews Commented Dec 7, 2016 at 17:46
  • example.com has index.html but api.example.com is hosted by laravel Commented Dec 7, 2016 at 18:27

2 Answers 2

4
  1. Mod_rewrite must be enabled on your server. Check this post

  2. 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.

Sign up to request clarification or add additional context in comments.

Comments

-1

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

1 Comment

I have created api.example.test on my local machine with the help of /etc/hosts and Apache virtual host. How can I solve this issue?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.