user2553832
user2553832

Reputation: 87

my htaccess is being ignored while working on a website in localhost

I've imported a website to my localhost, the homepage is opening great but the links are leading to 404, I'm using codeigniter which using htaccess to skip the index.php to load it's controllers and I believe that the reason for getting these 404s is skipping the htaccess...

Thank you

htaccess code:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|public|images|robots\.txt|css|swf)
RewriteRule ^(.*)$ index.php/$1 [L]

Virtual host code:

 DocumentRoot /var/www/mysite.com/public_html
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>
    <Directory /var/www/mysite.com/public_html/>
            AllowOverride None
            Order allow,deny
            allow from all
    </Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
        #AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
</Directory>

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

Upvotes: 0

Views: 129

Answers (1)

user4035
user4035

Reputation: 23729

Change AllowOverride None to AllowOverride All for your web site directory:

<Directory /var/www/mysite.com/public_html/>
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>

While it is none, .htaccess won't be processed: http://httpd.apache.org/docs/current/mod/core.html#allowoverride

Upvotes: 2

Related Questions