alleroy
@alleroy
Изучаю фреймворк laravel

Как исправить проблему в .htaccess?

После того как вписываю этот код в файл .htaccess

AddDefaultCharset utf-8

Options +FollowSymLinks
Options -Indexes
DirectoryIndex index.php

RewriteEngine On
RewriteBase /

RewriteRule ^([a-z]+)/([0-9]+)/$ /?controller=$1&id=$2&%{QUERY_STRING} [NS,L]

RewriteCond $1 !^(index\.php)
RewriteCond %{REQUEST_URI} !\.(css|js|jpg|gif)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php/$1 [L,QSA]


у меня пишет что Server error!

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.

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

Error 500

myshop.local
Apache/2.4.16 (Win32)

В чём может быть проблема? Я пользуюсь с openserver
  • Вопрос задан
  • 706 просмотров
Решения вопроса 1
@VladislavDovgopaty
Веб-разработчик
Скопируйте и вставьте:
AddDefaultCharset utf-8

Options +FollowSymLinks
Options -Indexes
DirectoryIndex index.php

RewriteEngine On
RewriteBase /

RewriteRule ^([a-z]+)/([0-9]+)/$ /?controller=$1&id=$2&%{QUERY_STRING} [NS,L]

RewriteCond $1 !^(index\.php)
RewriteCond %{REQUEST_URI} !\.(css|js|jpg|gif)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php/$1 [L,QSA]

Если ошибка исчезнет, то проблема была в символе #65279 в конце вашего кода:
50969f2c4b7d4c3085db96a702ea5883.png
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы