에서 나는이에서 내 URL을 다시 작성하기 위해 노력하고있어 :htaccess로 RewriteRule의가 작동하지 않습니다 - (404 오류) 서버
http://www.example.com/admin/index.php?id=title
에 : 내 htaccess로이 코드를 사용하고
http://www.example.com/admin/title
:
RewriteEngine On
RewriteRule ^([^/]*)\.html$ /admin/index.php?id=$1 [L]
하지만 재 작성된 URL을 시험해 보면 내 서버에서 404 오류가 발생합니다. 내가 뭘 만들고있는 실수 야? .htaccess는 admin이라는 하위 폴더에 있으며 다시 쓰기 규칙은 해당 폴더에서만 작동해야합니다.
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /admin/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)$ index.php?id=$1 [L]
2 개 개의 조건
우리는 존재하지 않는 파일을 리디렉션이나 폴더되지 않습니다 있는지 확인하고 규칙은 우리가 무엇을 추출 할 이야기 :
예. 그게 어떻게 설정되어있는거야. –
당신은'admin/title'이 아닌'/ admin/title.html'을 다시 쓰고 있습니다. – hjpotter92