Welcome Guest, Not a member yet? Register   Sign In
[Solved] htaccess, CodeIgniter, stand-alone Wordpress
#1

[eluser]zimco[/eluser]
I have a CodeIgniter application running in the root of mydomain.com and I am trying to run an installation of Wordpress installed in a folder: /news/ as a stand-alone application. Meaning i am NOT trying to get CI and WP to communicate with each other, or know anything about each other, or pass any data back and forth. I just want to let my CI app handle it's world, and let Wordpress handle it's world inside the news folder.

How can i get CodeIgniter to leave any Wordpress urls alone, and not try to interpret them or do anything with them? Right now anytime i click a link in Wordpress, CI tries to handle it and gives me 404 Not Found error.

I have a standard CI htaccess file in the root that removes the index.php from the url. Do i need to add something to the CI htaccess to get CI to ignore the /news folder and uri request? Or do i need an htaccess file in the /news folder, or both?

Or is it a case of running other php scripts alongside CI is not possible without all the hacking revealed by google searches when people try to integrate them? However, i do not want to integrate, just run each separately on the same server.
#2

[eluser]Sbioko[/eluser]
This *trick* can be done with .htaccess. So, yes, you need to edit your .htaccess file. If you can post it here, I can make it for you. Then CI will ignore requests for WP and all will be fine. ;-)
#3

[eluser]zimco[/eluser]
This is my htaccess:

Code:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://mydomain.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com/.*$      [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp|ico)$ - [F,NC]

# -CodeIgniter-
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]

php_value upload_max_filesize 50M
php_value post_max_size 50M
#4

[eluser]Sbioko[/eluser]
Here you are:
Code:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://mydomain.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com/.*$      [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp|ico)$ - [F,NC]

# -CodeIgniter-
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico|news)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]

php_value upload_max_filesize 50M
php_value post_max_size 50M
#5

[eluser]zimco[/eluser]
Gave your code a try but it was a no go. However, it gave me the webserver's custom 404 error rather than the CI 404 error msg. So, CI was not getting involved. Do i need some type of htaccess inside the news folder where Wordpress is located maybe?
#6

[eluser]Sbioko[/eluser]
ooh, yeah, I forgot about it. Please, give your .htaccess contents inside your WordPress folder.
#7

[eluser]zimco[/eluser]
I currently have no htaccess file in the Wordpress folder, news.

Do i need to put one in there? If so, what?

Or could the Wordpress index.php not run because of the remove index from CI urls command in the root level htaccess?
#8

[eluser]Uno*[/eluser]
if I understand what you're doing to try:

Code:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://mydomain.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com/.*$      [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp|ico)$ - [F,NC]

# -CodeIgniter-
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|news|images|css|js|robots\.txt|favicon\.ico|news)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]

php_value upload_max_filesize 50M
php_value post_max_size 50M
#9

[eluser]zimco[/eluser]
@Uno*, your english is good enough. I tried your code but it still gave me the server 404 not found for Wordpress in the news folder.

Also, not sure if you really meant me to have two 'news' in the line:

Quote:RewriteCond $1 !^(index\.php|news|images|css|js|robots\.txt|favicon\.ico|news)

Which was basically what Sbioko had me try, but with only the one, |news| on the end, to no avail. But thanks for trying to help!

Basically if i type in http://www.mydomain.com/ my CodeIgniter application runs as expected, but i want wordpress, which is installed, at http://www.mydomain.com/news/ to run without CodeIgniter interfering with wordpress and it's urls. Hope that makes sense.
#10

[eluser]Sbioko[/eluser]
Oh, I didn't see that. Sorry. What's with my eyes? ;-) I'll try to do such things on my localhost. And then I'll report you results.




Theme © iAndrew 2016 - Forum software by © MyBB