Jump to content

CodeIgniter URL


JamesB
 Share

Recommended Posts

This works on my web server but not on my friend's web server.

 

 

There are 3 websites like so:

 

1. http://www.ukscifi.net/ - Some old CMS.

2. http://www.ukscifi.net/uks2/ - CodeIgniter framework.

3. http://www.ukscifi.net/uks2/forum/ - SMF forum.

 

The problem is with the 2nd one.

 

When I go to a controller called "welcome", I get a 404.

This is the URL I go to: http://www.ukscifi.net/uks2/welcome

 

But on my local server I luckily don't get a 404.

 

Any ideas what could be causing this to not work?

 

 

Edit:

 

The .htaccess file in /uks2/ folder is:

 

 

RewriteEngine onRewriteCond $1 !^(index.php|public|robots.txt)RewriteRule ^(.*)$ /uks2/index.php/$1 [L]
Edited by JamesB
Link to comment
Share on other sites

I am running Apache/2.2.17 (Win32) PHP/5.3.5

My friend is running Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.5

 

I added this code to top of index.php in /uks2/ folder:

 

echo 'test1';exit;

And when going to this URL http://www.ukscifi.net/uks2/welcome I still get the 404.

 

The 404 I see isn't the CodeIgniter controller-not-found page either, it seems to be an Apache not found page.

Link to comment
Share on other sites

It's not going to show an echo statement if it shows the server 404 page, but writing to a log file will always work. That's why I suggested it. Otherwise, I would start with Apache's own log files to try and figure out what's going on. There is both an access log and an error log that you can check.

Link to comment
Share on other sites

When I visit the URL, there is nothing in error.log, but this is in access.log:

<my ip here> - - [25/Nov/2014:20:12:51 +0000] "GET /uks2/welcome HTTP/1.1" 404 506 "-" "Opera/9.80 (Windows NT 6.1; WOW64) Presto/2.12.388 Version/12.17"

Regarding the logging, would this be done in the htaccess file?

Edited by JamesB
Link to comment
Share on other sites

No, I'm talking about having PHP write something to a file so that you can tell that the PHP file was executed regardless of what shows up in the browser.After the 404 in that entry is 506. A 506 code would imply that the redirects are going to a page that is being redirected, or that index.php is set to redirect to index.php. The server sees that and stops the loop and just says 404. I'm not sure if that 506 refers to the HTTP response code, but if so then that's what it means.

Link to comment
Share on other sites

Ok I added a logging line:

 

 

file_put_contents('blah.txt', 'test1');

 

This file does not get created when I visit the URL, http://www.ukscifi.net/uks2/welcome

But the file does of course get created when I visit this URL: http://www.ukscifi.net/uks2/

 

I think the second number is the response size according to http://stackoverflow.com/questions/9234699/understanding-apache-access-log.

Link to comment
Share on other sites

I've followed the instructions on that website, still no luck.Still getting the Apache 404.

 

default.conf and ukscifi.conf in /etc/apache2/ now look like this:

 

<VirtualHost *:80>ServerName events.ukscifi.netServerAdmin keithvc1972@ukscifi.netDocumentRoot /Webroot/www/#LogLevel info ssl:warnErrorLog ${APACHE_LOG_DIR}/error.logCustomLog ${APACHE_LOG_DIR}/access.log combined#Include conf-available/serve-cgi-bin.conf</VirtualHost><Directory /var/www/>Options Indexes FollowSymLinks MultiViewsAllowOverride AllOrder allow,denyallow from all</Directory># vim: syntax=apache ts=4 sw=4 sts=4 sr noet

 

I made sure to reload Apache too.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...