• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
htaccess made me insane!!!

I have read a lot of topic with the same problem but i do not find the solution... please help me. I have a lamp into ubuntu server. My document root is /home/utente/ into this dir I have another dir (turni) with a codeigniter web app. The web app works fine with the "index.php" into the url, but I want to eliminate it. I have this configuration:

config.php into codeigniter:

$config['index_page'] = '';

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

<VirtualHost *:80>
    ServerAdmin [email protected]

    DocumentRoot /home/utente
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    <Directory /home/utente/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Allow from ::1/128
When i open a link of the web app with without eh "index.php" into the url, the server o me this error: The requested URL /turni/auth/login was not found on this server.

Why??? If i put the index.php like /turni/index.php/auth/login all works fine.... Thanks for help and sorry for my english Big Grin

Try with different RewriteBase in .htaccess file:

RewriteBase /turni/

Thanks for response!

I tried the different rewritebase but nothing change Sad

I tried also, with RewriteBase /, to put che apllication into the root (/home/utente/) but nothing change... with index.php tha app works fine, without index.php ----&gt; The requested URL was not found on this server.

Any other solutions ???

Is $config['base_url'] variable set well?
I think it should be

$config['base_url'] = 'http://localhost/turni/';

And check error logs both CI and apache what is said.

probably not the problem, but you can remove these 4 lines as these directories now include their own htaccess which prevents direct access to them.

RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

But I think the problem is you are setting AllowOverride None

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.