0
.htaccess 파일, CodeIgniter 용 및 Wordpress 용 파일이 필요합니다.CodeIgniter에서 Wordpress 카테고리로 리디렉션하는 htaccess 규칙
/application <-- CI Install
/news <-- WP Install
일반적으로, 나는 /news/topics/resources
에 다시 쓰는 URL /resources
을 갖고 싶어 다음과 같이 내 디렉토리 구조입니다. 또한 /resources/page/2
은 /news/topics/resources/page/2
등으로 다시 작성해야합니다.
저는 몇 가지 시도를 해 보았습니다.
CI htaccess로 파일 (/.htaccess에 위치) (/news/.htaccess에 위치)
<IfModule mod_rewrite.c>
RewriteEngine On
Options +FollowSymlinks
RewriteBase/
#This should redirect /news/topic/resources/ to /resources
#RewriteRule resources/ /news/topic/resources [NC]
#RewriteRule /resources/^(.*)\ /news/topic/resources/$1
#RewriteRule ^resources/ news/topic/resources/ [NC]
#RewriteRule ^resources$ news/index.php?cat=825 [L]
#RewriteRule ^resources/(.*)$ news/$1 [R,L]
#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Submitted by: Fabdrol
#Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin
ErrorDocument 404 /index.php
</IfModule>
WP htaccess로 파일
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /news/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /news/index.php [L]
</IfModule>
# END WordPress
: 아래에 나열하는 것은 내 CodeIgniter의와 포스트 htaccess로 파일입니다
도움을 주시면 대단히 감사하겠습니다. 감사.
아쉽게도 이것은 작동하지 않았습니다. Wordpress에서 다시 쓰기를 처리하는 방식과 관련이 있다고 생각합니다. 지금 wp_rewrite 살펴보기. – sdover102