Welcome Guest, Not a member yet? Register   Sign In
Which .htaccess is it?
#1

[eluser]piper-coda[/eluser]
Hi, I am putting up a site that was developed, I think there may be a problem with either the .htaccess file, or, the index.php file. I have no idea which one it is. Needless to say, the application works on my local system, no problems there.

The URL is is http://www.microkan.com.php4-2.websitetestlink.com

This is the current one:
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

This one was the previous one:
Code:
RewriteEngine on
RewriteBase /
Options +FollowSymLinks
RewriteCond $1 !^(index\.php|images|js|media|info\.php|css|userfiles|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

And this was htacess.txt on the server (Not sure how it ended up there):
Code:
RewriteEngine on
#RewriteBase /
RewriteRule ^$ index.php [L]
RewriteCond $1 !^(index\.php|img|media|css|js|user_guide|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ index.php/$1 [L]

This is the index.php file:
Code:
<?php

error_reporting(E_ALL);

/*
|------------------------------------------------
| SYSTEM FOLDER NAME
|------------------------------------------------
|
| This variable must contain the name of your "system"
| folder. Include the path if the folder is not in the same
| directory as this file.  No trailing slash
*/

    $system_folder = "system";

/*
|------------------------------------------------
| APPLICATION FOLDER NAME
|------------------------------------------------
|
| If you want this front controller to use a specific
| "application" folder you can set its name here.
| By doing so you can have multiple applications share
| a common set of Code Igniter system files.
| Note: It is assumed that your application folder will
| be located within the main system/application folder.
| For example, lets say you have two applications,
| "foo" and "bar":
|
|  system/application/foo/
|  system/application/foo/config/
|  system/application/foo/controllers/
|  system/application/foo/errors/
|  system/application/foo/scripts/
|  system/application/foo/views/
|  system/application/bar/
|  system/application/bar/config/
|  system/application/bar/controllers/
|  system/application/bar/errors/
|  system/application/bar/scripts/
|  system/application/bar/views/
|
| If you would like to use the "foo" application you'll
| set the variable like this:
|
|    $application_folder = "foo";
|
*/

    $application_folder = "";

/*
|================================================
| END OF USER CONFIGURABLE SETTINGS
|================================================
*/

if (function_exists('realpath') AND @realpath(dirname(__FILE__)) !== FALSE)
{
    $system_folder = str_replace("\\", "/", realpath(dirname(__FILE__))).'/'.$system_folder;
}

if ($application_folder != '')
{
    $application_folder .= '/';
}

// Older versions of PHP don't support this so we'll explicitly define it
if ( ! defined('E_STRICT'))
{
    define('E_STRICT', 2048);
}

define('EXT', '.'.pathinfo(__FILE__, PATHINFO_EXTENSION));
define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
define('BASEPATH', $system_folder.'/');
define('APPPATH', BASEPATH.'application/'.$application_folder);


require_once BASEPATH.'codeigniter/CodeIgniter'.EXT;
?>


If anyone could please shed some light on what's going on with this, I would appreciate it, I realize it's a bit much, but help would be appreciated.
#2

[eluser]alpar[/eluser]
This is a .htaccess error i think, the server (apache) doesn't like something in it. Try changing it around, and look for mistakes in the .htaccess file. (sory i'm in a rush, can't point out mistakes for you right now)
#3

[eluser]Phil Sturgeon[/eluser]
Both your previous ones will cause errors. I'm not sure what's wrong with your newest one, but that still isn't the best method for getting CI short urls going. Try this one:

Quote:RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|cgi-bin|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

This allows any existing files and folders to be accessed and anything that doesn't actually exist will go to CI. I guess the (index\.php|cgi-bin|robots\.txt) is made redundant but who cares.




Theme © iAndrew 2016 - Forum software by © MyBB