2017-09-09 1 views
0

gefunden Objekt, das ich eine Website in Laravel entwickle, der gut arbeitet, aber, aber es gibt kleines Problem in meiner URLURL nicht richtig in Laravel arbeitet Umleitungen nicht

Meine url funktioniert gut

http://localhost:8080/JobScholar/contact 
http://localhost:8080/JobScholar/index 

aber wenn ich benutze eine / am Ende der uRL

http://localhost:8080/JobScholar/contact/ 
http://localhost:8080/JobScholar/index/ 

leitet mich zu

http://localhost:8080/index 
http://localhost:8080/contact 

Object not found! 

The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again. 

If you think this is a server error, please contact the webmaster. 

Error 404 

localhost 
Apache/2.4.26 (Win32) OpenSSL/1.0.2l PHP/7.1.7 

.htaccess

<IfModule mod_rewrite.c> 
    <IfModule mod_negotiation.c> 
     Options -MultiViews 
     Options -Indexes 
     ErrorDocument 403 http://localhost:8080/JobScholar/index 
     Options +FollowSymLinks 
    </IfModule> 

    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}] 
</IfModule> 

Routen

Route::get('/contact', '[email protected]'); 
    Route::get('/index', '[email protected]'); 
+0

Ich vermute, das bis zu einem gewissen Fehlkonfiguration auf .htaccess zurückzuführen ist. Können Sie Ihren .htaccess-Inhalt hier einfügen? –

+0

Auch ein Blick auf Ihre 'DirectoryIndex'-Einstellung könnte einen Versuch wert sein: https://httpd.apache.org/docs/current/mod/mod_dir.html#directoryindex – arkascha

+0

teilen Sie Ihre '.htaccess' und' Routen' für diese? – C2486

Antwort

0

Versuchen Sie mit dem Hinzufügen von RewriteBase /JobScholar/ kurz nach RewriteEngine On

0

ich nicht sicher, aber ich glaube, Sie ändern müssen in Ihren .htaccess

Von

RewriteRule ^(.*)/$ /$1 [L,R=301] 

Um

RewriteRule ^(.*)/$ /JobScholar/$1 [L,R=301] 
+0

nicht für mich gearbeitet –