제목과 ID로 동적으로 URL을 다시 작성해야합니다. 나는이제목과 ID로 동적 URL 다시 작성
" Not Found
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
The requested URL /beweb/iphone-8.html was not found on this server."
..하지만 점점 오류가 나는 내가 필요 dyanamically되어 있으므로 위의 URL을 실행하면 URL을 동적
http://dev.example.com/beweb/iphone-8.html
대신
http://dev.example.com/beweb/newsdetails.php?id=8&title=iphone
으로 만들고 싶어 코드 아래에 사용됨 :
RewriteEngine On
RewriteCond %{THE_REQUEST} /beweb/newsdetails.php\?id=([^&\s]+)&title=([^&\s]+) [NC]
RewriteRule^/beweb/%2-%1\.html? [NC,R,L,NE]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^%2-([^.]+)\.html$ /beweb/newsdetails.php?id=$1&title=$2 [QSA,L,NC]
도와주세요.
에 쿼리 문자열을 추가하는 것을 의미하며 일하고있어. 하지만 URL에서 ID (매개 변수를 얻으려고)를 원할 것이기 때문에 다른 문제가 발생합니다 .. 이제 오류가 발생했습니다. 제발 나를 도울 수 있습니까? – Jeff
@Jeff 위의'$ 1'과'$ 2'를 교환하십시오. – hjpotter92
나는 당신을 도울 필요가있다 .. 할 수있다 – Jeff