Welcome Guest, Not a member yet? Register   Sign In
On .htaccess & Playing Nice With EE pre-2.0
#1

[eluser]jpcody[/eluser]
Hey guys, I need to figure out a solution to last me the next 12 days.

I've got my home page at http://joshuacody.net/index.php built on CodeIgniter.

I've got the rest of my site built on ExpressionEngine.

To make this work, I have renamed my EE index.php file to index2.php.

Then, I have an .htaccess file (generated using LG .htaccess generator) file that is removing index2.php.

But my CodeIgnited home page is demanding index.php appended to the URL. If I removed the .htaccess file altogether, it no longer demands index.php.

Any ideas on how I can fix this? My current .htaccess:

Code:
RewriteEngine On

RewriteBase /

# remove the www
RewriteCond %{HTTP_HOST} ^(www\.$) [NC]
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Remove index.php
# Uses the "include method"
# http://expressionengine.com/wiki/Remove_index.php_From_URLs/#Include_List_Method
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5})$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} ^/(site|search|rss|include|commentary||members|P[0-9]{2,8}) [NC]
RewriteRule ^(.*)$ /index2.php?/$1 [L]

Thanks so much for any suggestions you could give on this!
#2

[eluser]Phil Sturgeon[/eluser]
It will require index.php because you have no rule to redirect to it.

You have your EE rules, add the normal CI rules back in.
#3

[eluser]jpcody[/eluser]
Hey Phil, I've tried this to no avail.

I'm not sure exactly what's happening here, but I *think* what's happening is that http://joshuacody.net is being rewritten to http://joshuacody.net/index2.php. Each of them are giving me a plain white browser window.

Is too much possibly being included in my Rewrite Cond?
#4

[eluser]jpcody[/eluser]
In the off chance that anyone comes back across this, I'd still love to hear feedback. The previous code breaks, and the following code breaks differently:

Code:
RewriteEngine On

# Remove index.php
# Uses the "include method"
# http://expressionengine.com/wiki/Remove_index.php_From_URLs/#Include_List_Method
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5})$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} ^/(main_css|img|js|site|search|rss|include|commentary||members|P[0-9]{2,8}) [NC]
RewriteRule ^(.*)$ /index2.php?/$1 [L]

RewriteEngine on
RewriteCond $1 !^(main_css|js|img|index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

This allows me to visit http://joshuacody.net sans index.php, but it required index.php on the EE side of things and forgets how to access the CSS, image and javascript files.

Am I combining the two sets of rules incorrectly?




Theme © iAndrew 2016 - Forum software by © MyBB