2016-07-12 3 views
2

내 URL에 매개 변수가 있습니다. 나는 그것이하위 디렉토리의 매개 변수가있는 루트 폴더에 Htaccess 다시 쓰기

되고 싶어요 :

https://www.example.com/subdirectory/reset-password/123/123 

내가 먼저 (123)가 첫 번째 매개 변수와 두 번째 매개 변수 내가 아래 링크에 대한 규칙을 만드는 중이라서 123

입니다 https://www.example.com/reset-password/123/123

되고 싶어

I want it to be `https://www.example.com/reset-password/123/123` 
01,235,164에
https://www.example.com/subdirectory/reset-password?p=123&q=123 

나는 Hide folder name from particular URL using .htaccess

답변

2

사용 기준으로 다음과 같은 링크를 사용하고이 :

RewriteEngine On 
RewriteRule ^reset-password/([^/]*)/([^/]*)$ /subdirectory/reset-password?p=$1&q=$2 [L] 

그것은 당신에게 다음과 같은 URL 줄 것이다 :

https://www.example.com/reset-password/123/123

+0

[L의 의미는 무엇인지를 ] –

+0

[L] 플래그는 "last"를 나타내며 다시 쓰기로 인해 규칙 처리가 중지됩니다. 즉, 규칙이 일치하면 더 이상 규칙이 처리되지 않습니다. – Lag

관련 문제