htaccess - 1레벨 이상의 리디렉션이 작동하지 않습니다.

htaccess - 1레벨 이상의 리디렉션이 작동하지 않습니다.

방금 GoDaddy의 공유 호스팅으로 옮겼으며 .htaccess 규칙이 작동하도록 노력하고 있습니다.

내가 가진 것은 다음과 같습니다.

ErrorDocument 404 /error.php
Options FollowSymLinks

RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} ^www\.mydomain\.org$
RewriteRule ^(.*)$ http://mydomain.org/$1 [R=301,L]

RewriteRule ^view/(\w+)$ viewitem.php?itemid=$1 [R=301,L]
RewriteRule ^category/(\w+)$ viewcategory.php?tag=$1 [R=301,L]

RewriteRule ^faq$ faq.php
RewriteRule ^about$ about.php
RewriteRule ^contact$ contact.php
RewriteRule ^submit$ submit.php
RewriteRule ^contactmsg$ handler-contact.php

도메인 루트의 모든 페이지(예: mydomain.org/faq, mydomain.org/about)가 작동하는 것 같습니다.

하지만 mydomain.org/category/somecategory를 시도할 때마다 404가 표시됩니다. 1레벨 이상의 규칙을 따르도록 .htaccess를 수정하려면 어떻게 해야 합니까?

감사해요,

편집: 규칙을 다음과 같이 변경하여 수정했습니다.

RewriteRule ^view/(.*)$ viewitem.php?itemid=$1
RewriteRule ^category/(.*)$ viewcategory.php?tag=$1

누구든지 이것이 사실임을 확인/거부할 수 있습니까?적절한이 문제를 해결하는 방법?

답변1

(를 사용하여) 수행하는 새로운 방식이 (.*)정확합니다.

관련 정보