Welcome Guest, Not a member yet? Register   Sign In
Password-Protected Directories w/ WordPress Installs
#3

(This post was last modified: 02-11-2016, 12:35 AM by skunkbad.)

Yes. You will need to use mod_rewrite inside an .htaccess file. Rename your CodeIgniter index.php file to ci_index.php, then use mod_rewrite to create rewrite rules that get routed to ci_index.php if they are routes that should be for CI. Anything else goes to WordPress.

I've done this successfully a number of times. For example:


Code:
# URLs routed to CodeIgniter
RewriteRule ^accounts$ /ci_index.php [L]
RewriteRule ^administration/.*$ /ci_index.php [L]

# No need to allow access to the following files
RewriteRule ^(wp-admin/install.php|xmlrpc.php|wp-trackback.php|wp-mail.php|wp-signup.php|wp-links-opml.php|wp-settings.php|wp-config.php|wp-load.php|wp-cron.php|wp-blog-header.php|wp-activate.php) - [F,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]

In this example, index.php is WordPress' index.php.

This is actually really handy, because WordPress is lame when it comes to creating custom forms and ecommerce sites.
Reply


Messages In This Thread
RE: Password-Protected Directories w/ WordPress Installs - by skunkbad - 02-11-2016, 12:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB