문제는 첫 번째 URL이 작동하고 두 번째 URL이 작동하지 않는다는 것입니다.후행 슬래시 제거 및 html 리디렉션
http://www.example.com/podcast/episode1
http://www.example.com/podcast/episode1/
비 후행 슬래시 버전으로 모든 후행 슬래시 버전을 리디렉션하는 방법이 있나요?
example.com/podcast
example.com/podcast/
만이 하나가 작동합니다 :이 작품의도 이후
이 문제는 여기에 더 악화입니다
example.com /podcast.html
및 html 확장자 표시를 원하지 않습니다.
여기 내 htaccess로 파일에 내가 가진 코드는 지금까지의 :
#shtml
AddType text/html .html
AddHandler server-parsed .html
#html
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]
#index redirect
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/
RewriteRule ^index\.html$ http://example.com/ [R=301,L]
#non www to www
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
당신이 나를 도울 수 있습니까?
또한 html 버전을 비 -HTML 버전으로 리디렉션하려고합니다. 예를 들어 http://www.pavlinaplus.com/podcast/reality.html을 http://www.pavlinaplus.com/podcast/reality로 리디렉션하려고합니다. – Jeremy