2014-12-10 2 views
1

좋아, 어쩌면 내가 덤프지만 내 간단한 재 작성 .htacces 규칙이 작동하지 않습니다. www.mysite.com/something.html 예를 들어 내 사이트에 www.mysite.com/something에 규칙을 다시 작성하기 만하면됩니다.간단한 재 작성 규칙

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME}.html -f 
RewriteRule ^(.+)$ $1.html [L,QSA] 
AddType application/x-httpd-php5 .htm .html 

답변

2

당신은 .html를 리디렉션에 대한 다른 규칙이 필요합니다 :

나는

지금은 내 .htacces 파일이이 있지만 작동하지 않는 파일 something.html에서 .html 중에서 및 점점 컨텐츠를 제거 할 YUST

RewriteEngine On 

# To externally redirect /dir/file.php to /dir/file 
RewriteCond %{THE_REQUEST} \s/+(.+?)\.html[\s?] [NC] 
RewriteRule^/%1 [R=302,L,NE] 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME}.html -f 
RewriteRule ^(.+)$ $1.html [L,QSA] 
AddType application/x-httpd-php5 .htm .html 
+1

감사합니다, 그것은 매력처럼 작동합니다 :-D –

+0

다행 이네, 반가워요. – anubhava