2014-12-08 6 views
0

평소처럼 .htaccess를 일부 웹 페이지로 리디렉션하려고합니다.htaccess의 "Folder of folder"

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^Profile/(.+)/?$ index.php?page=profile&username=$1 [NC,L] 
RewriteRule ^profile/(.+)/?$ index.php?page=profile&username=$1 [NC,L] 

RewriteRule ^Profile/Me index.php?page=profile [NC,L] 
RewriteRule ^Profile/me index.php?page=profile [NC,L] 
RewriteRule ^profile/Me index.php?page=profile [NC,L] 
RewriteRule ^profile/me index.php?page=profile [NC,L] 


RewriteRule ^Personagem/(.+)/?$ index.php?page=personagem&personagem=$1 [NC,L] 
RewriteRule ^personagem/(.+)/?$ index.php?page=personagem&personagem=$1 [NC,L] 

을 그리고 여기에 내가해야 할 것입니다 : 내가 작업을 얻었는지 는 여기

/Personagem/--name of character--/Album 
: 나는 "Personagem"페이지에있을 때는, 나는 다음과 같은 URL에 모든 "앨범"에 액세스 할 수 있습니다

, --name of character--, 매개 변수는 /Personagem입니다. 가능한가?

+1

누가 쓴 NC (어떠한 경우)와 프로파일 또는 프로파일을 ... 추가 할 필요성 그럼 기존 RewriteRules? 마지막 부분을 복제하고'/ Album'을 패턴에 추가하면 어떨까요? 이미 [NC]를 사용하고 있어도 모든 규칙이 다른 케이스로 중복되는 이유는 무엇입니까? – mario

+0

코드 복사/붙여 넣기. 나는 "MC, L"측정이 아직 무엇인지 모르겠다. ( – markus

+0

마지막으로 복사/붙여 넣기를하면 내 'Personagem'이름 매개 변수가 "name/Album"이되고 "name"은 instim 됨 – markus

답변

0

당신은 사용할 수 있습니다

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^profile/(.+)/?$ index.php?page=profile&username=$1 [NC,L] 
RewriteRule ^profile/me index.php?page=profile [NC,L] 
RewriteRule ^personagem/([^/]+)/?$ index.php?page=personagem&personagem=$1 [NC,L] 
RewriteRule ^personagem/([^/]+)/([^/]+)/?$ index.php?page=personagem&personagem=$1&album=$2 [NC,L] 

당신이 다른 추가 할 수 있습니다

RewriteRule ^personagem/([^/]+)/([^/]+)/([^/]+)/?$ index.php?page=personagem&personagem=$1&album=$2&other=$3 [NC,L] 

+0

이 경우 URL은 "/ Personagem/Name/Album/1"대신 "/ Personagem/Name/1" 1 "? – markus

+0

예.'/ Album /'폴더를 추가 하시겠습니까? – Croises

+0

예, 예, please D : – markus