문제

I have a domain, let's say somedomain.com. I have an admin page somedomain.com/admin. The pages were coded in plain PHP. I recently re-wrote somedomain.com in CodeIgniter. But I do not want to touch somedomain.com/admin for now.

How do I make this work? When I go to somedomain.com/admin, it is looking an admin controller, which of course does not exist. I have an index.php file in admin folder, I cannot figure out a way to access the index file.

Thank you.

도움이 되었습니까?

해결책

You should post .htaccess for us to se. But anyway. You should exclude "admin" to be directed to index.php

something like this

RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
RewriteCond %{QUERY_STRING} ^(ACT=.*)$ [NC]
RewriteRule ^(.*)$ index.php?%1 [L]
RewriteCond $1 !^(admin|index.php) [NC]
RewriteRule ^(.*) /index.php?/$1 [L]

다른 팁

Like this :

RewriteEngine On
RewriteBase /
RewriteCond $1 !^(index\.php|assets|thirdparty|admin|themes|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top