LouieV
LouieV

Reputation: 1052

Bad flag delimiters .htaccess

Im testing out URL rewritting but Im having issues with htacces. I have

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} != d
RewriteCond %{REQUEST_FILENAME} != f
RewriteCond %{REQUEST_FILENAME} != l

RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

and my vhost looks like

<VirtualHost *:80>
        ServerAdmin [email protected]
        ServerName www.mvc.com
        ServerAlias my.mvc

        DocumentRoot /home/user/Documents/MyMVC

        <Directory /home/user/Documents/MyMVC>
            Require all granted
            AllowOverride all
        </Directory>

        ErrorLog /home/user/SiteLogs/mvc/error.log
</VirtualHost>

With this settings Im getting /home/user/Documents/MyMVC/.htaccess: RewriteCond: bad flag delimiters Im not sure what am I missing. Thanks in advance.

Upvotes: 0

Views: 402

Answers (2)

wspurgin
wspurgin

Reputation: 2733

The Rewrite Conditions are flags not "!=" Should look something like this

RewriteCond %{REQUEST_FILENAME} !-f

Upvotes: 1

Marc B
Marc B

Reputation: 360702

!= is not a valid option in RewriteConds: http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritecond

RewriteCond %{REQUEST_FILENAME} !-d
                                 ^--- "dash", not "equals"

Upvotes: 1

Related Questions