2014-04-02 2 views
2

url의 마지막 위치로 게시물 ID를 이동하고 싶습니다. 나는RewriteRule : url에서 id 기사 이동

RewriteRule ^([^.]+)/(.*)-([0-9]+).html$ index.php?newsid=$2&seourl=$3&seocat=$1 [L] 

로 변경하고 브라우저에 새로운 URL을 http://www.mysite.com/news/post-123.html을 붙여 그러나 그것은 작동하지 않습니다

http://www.mysite.com/news/123-post.html 

RewriteRule ^([^.]+)/([0-9]+)-(.*).html$ index.php?newsid=$2&seourl=$3&seocat=$1 [L] 

http://www.mysite.com/news/post-123.html 

원래 htaccess로

에이 같이

+0

당신이 당신의 전체를 보여줄 수있는 ENTIER 경로 같은 폴더에하지 수 있도록하려면

또한, seourl 어떤 슬래시 (/)를 포함하지 않도록함으로써 규칙을 최적화 할 수 있습니다. htaccess 파일? – anubhava

답변

0

news idseo url 매개 변수를 서로 바꿨습니다. 규칙에서 똑같이해야합니다.

이 규칙 (새)

RewriteRule ^([^.]+)/(.*)-([0-9]+).html$ index.php?newsid=$2&seourl=$3&seocat=$1 [L] 

RewriteRule ^([^.]+)/(.*)-([0-9]+).html$ index.php?newsid=$3&seourl=$2&seocat=$1 [L] 

$2 같이해야 할 것은 seourl에 지금과 $3newsid에 지금이다. 그렇지 않으면 문제가 발생할 것입니다. 당신은 단지

RewriteRule ^([^.]+)/([^/]+)-([0-9]+).html$ index.php?newsid=$3&seourl=$2&seocat=$1 [L] 
+1

감사합니다. 저스틴 – NuLL

관련 문제