skip to Main Content

When I go to a specific url on my local machine using XAMPP

enter image description here

In the production server

enter image description here

Locally the request has no response data available

enter image description here


There are other pages which use the same headers and footer as this one and they load fine both locally and in the production server.

Here’s what the edit looks like

/**
 * Show the form for editing the specified resource.
 *
 * @param  AppOrganizationUser  $org_user
 * @return IlluminateHttpResponse
 */
public function edit(Request $request, OrganizationUser $org_user, Organization $model1, User $model2)
{
    // Check if user is admin
    $auth_user = Auth::user();

    $path = $request->path();

    $organization_id = (int)explode('/', $path)[1];

    $user_id = (int)explode('/', $path)[3];

    //dd($org_user->load('user')->load('organization'));

    if($auth_user->isAdmin()) {

        return view('organizations.users.edit', [
                                                'org_user' => $org_user->load('user')->load('organization')->where('id', $user_id)->first(),
                                                'organizations' => $model1::where('id', $organization_id)->get(['id', 'name']),
                                                'users' => $model2->get(['id', 'name'])
                                                ]);        
    
    } else {


        abort(404);

    }
    
}

What have I tried so far

  1. Clear configuration cache
php artisan config:clear
  1. Clearing route cache
php artisan route:clear
  1. Clearing view cache
php artisan view:clear
  1. Clearing event cache
php artisan event:clear
  1. Clearing application cache
php artisan cache:clear
  1. Clearing all cache
php artisan optimize:clear
  1. Clearing content from Composer’s cache
composer dump-autoload
  1. Clearing NPM cache
npm cache clean --force
  1. Use a different browser (tested both in Chrome and Firefox).

  2. Restart Apache through the XAMPP console.

  3. Restart the computer.


Edit

Upon request, here’s the .htaccess present in the /public folder

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

2

Answers


  1. Chosen as BEST ANSWER

    The way I've managed to make it work was to disable XAMPP's Apache and run instead

    php artisan serve
    

    Now I'm able to use it just fine.

    enter image description here


  2. Try this, change your httacces file:

    <IfModule mod_rewrite.c>
        RewriteEngine on
        RewriteCond %{REQUEST_URI} !^public
        RewriteRule ^(.*)$ public/$1 [L]
    </IfModule>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search