처음으로 .htaccess URL 재 작성의 세계에 내 발가락을 담그고 첫 번째 장애물에 넘어 섰습니다. 그러나 확실한 뭔가를 놓치고 확신 해요 ... :)htaccess 문제를 사용하여 URL 재 작성
내 htaccess는 현재/wordpress에서 실행하지만 다시 작성되어 도메인의 최상위 수준에 나타나도록 다시 작성된 Wordpress입니다.
php_value short_open_tag 1
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule^- [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) wordpress/$2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ wordpress/$2 [L]
RewriteRule . index.php [L]
</IfModule>
나는 액세스하는 사람을 위해 재 작성 규칙을 추가 할 : xxx는 숫자 가 /간행물/퍼브-XXX/
생각입니다 /publication-details.php?id=xxx을 (이런 식으로 작동합니다 :
RewriteRule ^publication-details.php?id=([0-9]+) /publications/pub-$1 [NC]
하지만 기존 규칙에서 어디서 주문 했든 상관 없지만 작동하지 않습니다. /publication-details.php를 방문하면 404 (Apache 기본값)가 표시됩니다. URL을 확장하지 않으려 고 시도하면// Wordpress 404가 표시됩니다.
무엇이 없습니까?
미리 감사드립니다.
감사합니다. htacces에 직접 규칙을 삽입하는 대신 이점이 있습니까? – user3204476