내 htaccess 코드에 문제가 있다고 생각하지만 알아낼 수 없습니다.Htacess를 사용하여 폴더 이름 제거
내가 필요한 것은 무엇입니까?
1) 폴더 이름을 제거) www.domain.com/index 대신 www.domain.com/index.php
이 같은 주소에서 .PHP 확장자를 제거합니다. 내 웹 사이트 파일은 public이라는 폴더에 저장됩니다. 나는 그것을 제거하고 싶다. www.domain.com/public/index.php to www.domain.com/index
다음 코드를 작성했습니다.이 문제에 대해 알려주십시오.
# This will hide the folder name public and the php text
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteCond %{REQUEST_URI} !/$
RewriteRule (.*) $1\.php [L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+public/([^\s]+) [NC]
RewriteRule^%1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
# if you face any problem than try to uncomment the below line and delete the line after it
RewriteRule (?!^public/)^(.*)$ public/$1 [L,NC]
가능한 중복 : ([htaccess로와 확장을 .PHP 제거] http://stackoverflow.com/questions/4026021/remove-php -extension-with-htaccess) – Azrael
1)'Options + MultiViews'를 사용하십시오 – Phil
누군가가 downvoted 이유를 말해 줄 수 있습니까? – user3477550