2014-05-17 2 views
1

여기 내가하려는 일이 있습니다. 나는이 URL을, 오래된 형태와 새로운 양식htaccess로 다시 작성

site.com/video.php -> site.com/video 
site.com/index.php?cat_id=1 -> site.com/some-cat-name 

다음 마지막 두 중 하나가 댓글을 달았 경우에만 작동하고 내 htaccess로 파일이 있어요. 그 두 활성화 된 경우

Options +FollowSymLinks 
RewriteEngine on 
RewriteBase/
RewriteRule ^\.htaccess$ - [F] 
RewriteCond $1 !^(index\.php|img|js|css|admin|robots\.txt) 
RewriteRule ^video$ /videos.php/$1 [L] 
#RewriteRule ^(.*)$ /index.php/$1 [L] 

서버 오류 500

에게 반환
RewriteRule ^video$ /videos.php/$1 [L] 
RewriteRule ^(.*)$ /index.php/$1 [L] 

내 논리는 첫째는이 라인에서 모든 videos.php 잊지에 대한 URL 리디렉션에 비디오를 일치하는 경우, 그러나 보인다 다른 방법으로. 어떤 사람은 사전에 정의 된 URL과 다른 모든 사람들이 index.php, tnx를 진행하는 방법을 설명 할 수 있습니까?

답변

1

규칙이 규칙에 반복되기 때문에 500 (내부 서버 오류)를 얻고있다 :

Options +FollowSymLinks 
RewriteEngine on 
RewriteBase/
RewriteRule ^\.htaccess$ - [F] 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond $1 !^(index\.php|img|js|css|admin|robots\.txt) 
RewriteRule ^video$ /videos.php/$1 [L] 

# ignore existing files and directories from rewrite 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ /index.php/$1 [L] 
:

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

이 규칙이 같이 당신의 .htaccess을 수정하려면