adit
adit

Reputation: 33674

.htaccess not triggered

So I have the following .htaccess in my /var/www/site

RewriteEngine on
RewriteRule ^([^/]+)/?$ parser.php?id=$1 [QSA,L]

I have allowed override in my vhost:

<Directory />
                Options FollowSymLinks
                AllowOverride All
        </Directory>
        <Directory /var/www/site>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                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>

UPDATE: Now I got it to work, however when I visit site.com, it also redirects me to this parser.php, in which I don't want as this is my homepage. My homepage should be redirected to index.php and if I do mysite/NASKDj, it should be redirected to parser.php?pid=NASKDj. How do I fix this?

Upvotes: 0

Views: 75

Answers (2)

xdazz
xdazz

Reputation: 160883

I just saw AllowOverride None in your <Directory /var/www/site>...</Directory>, So?

Upvotes: 0

Richard Edwards
Richard Edwards

Reputation: 2060

You have 'AllowOverride None' in the '/var/www/site' directory - this will overrive the one specified in the '/' directory. If your site is in /var/www/site you need to change This one to All too.

Upvotes: 1

Related Questions