Forum Moderators: phranque

Message Too Old, No Replies

bad flag delimiters from .htaccess

         

Maverick89

12:53 am on Mar 13, 2011 (gmt 0)

10+ Year Member



I keep getting the error bad flag delimiters. Here's my .htaccess file. I had used this on a different server and it worked dine but after I moved to a different one resulted the error. Any ideas?

RewriteEngine on
<Files .htaccess>
order allow,deny
deny from all
</Files>

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>

<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>

AuthName virtualteen.org
AuthUserFile /home/virtualt/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/virtualt/public_html/_vti_pvt/service.grp

php_value error_reporting E_ALL
php_flag display_errors On

Options +FollowSymLinks
DirectoryIndex index.php

IndexIgnore *

RewriteBase /

RewriteCond %{HTTP_HOST} !^www\.virtualteen\.org$
RewriteRule ^(.*)$ [virtualteen.org...] [R=301,L]

RewriteCond %{REQUEST_URI} ^/topics/downtime$
RewriteRule ^(.*)$ [virtualteen.org...] [R=302,L]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(forums/)?index\.(php|html?)\ HTTP/
RewriteRule ^(forums/)?index\.(php|html?)$ /%1 [R=301,L]

RewriteCond %{REQUEST_URI} ^/forums//(.*)$
RewriteRule ^forums//(.*)$ forums/%1 [R=301,L]

RewriteCond %{REQUEST_URI} ^/topics/community/forums$
RewriteRule ^(.*)$ [virtualteen.org...] [R=301,L]

RewriteCond %{REQUEST_URI} ^/topics/parents/alcoholc$
RewriteRule ^(.*)$ [virtualteen.org...] [R=301,L]

RewriteCond %{REQUEST_URI} ^/topics/parents/chldabuse$
RewriteRule ^(.*)$ [virtualteen.org...] [R=301,L]

RewriteCond %{REQUEST_URI} ^/topics/parents/eval$
RewriteRule ^(.*)$ [virtualteen.org...] [R=301,L]

RewriteCond %{REQUEST_URI} ^/topics/parents/fostercare$
RewriteRule ^(.*)$ [virtualteen.org...] [R=301,L]

RewriteCond %{REQUEST_URI} ^/topics/parents/gayteens$
RewriteRule ^(.*)$ [virtualteen.org...] [R=301,L]

RewriteCond %{REQUEST_URI} ^/topics/parents/hs_develop$
RewriteRule ^(.*)$ [virtualteen.org...] [R=301,L]

RewriteCond %{REQUEST_URI} ^/topics/parents/learningdis$
RewriteRule ^(.*)$ [virtualteen.org...] [R=301,L]

RewriteCond %{REQUEST_URI} ^/topics/parents/medquest$
RewriteRule ^(.*)$ [virtualteen.org...] [R=301,L]

RewriteCond %{REQUEST_URI} ^/topics/parents/parentmi$
RewriteRule ^(.*)$ [virtualteen.org...] [R=301,L]

RewriteCond %{REQUEST_URI} ^/topics/parents/midsch_develop$
RewriteRule ^(.*)$ [virtualteen.org...] [R=301,L]

RewriteCond %{REQUEST_URI} ^/topics/parents/psychmed$
RewriteRule ^(.*)$ [virtualteen.org...] [R=301,L]

RewriteCond %{REQUEST_URI} ^/topics/parents/sexualabuse$
RewriteRule ^(.*)$ [virtualteen.org...] [R=301,L]

RewriteCond %{REQUEST_URI} ^/topics/parents/stepfmly$
RewriteRule ^(.*)$ [virtualteen.org...] [R=301,L]

RewriteCond %{REQUEST_URI} ^/topics/parents/talksex$
RewriteRule ^(.*)$ [virtualteen.org...] [R=301,L]

RewriteCond %{REQUEST_URI} ^/topics/parents/teendrug$
RewriteRule ^(.*)$ [virtualteen.org...] [R=301,L]

RewriteCond %{REQUEST_URI} ^/topics/parents/violentbehavior$
RewriteRule ^(.*)$ [virtualteen.org...] [R=301,L]

RewriteCond %{REQUEST_URI} ^/topics/parents/wherehelp$
RewriteRule ^(.*)$ [virtualteen.org...] [R=301,L]

RewriteRule ^topics/([^/]+)/([^/]+)/([^/]+)/?$ topics.php?category=$1&section=$2&page=$3 [L]
RewriteRule ^topics/([^/]+)/([^/]+)/?$ topics.php?category=$1&section=$2 [L]
RewriteRule ^topics/([^/]+)/?$ topics.php?category=$1 [L]
RewriteRule ^topics/?$ topics.php [L]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /topics\.php\?category=([^&]+)&section=([^&]+)&page=([^\ ]+)\ HTTP/$
RewriteRule ^topics\.php$ topics/%1/%2/%3 [R=301,L]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /topics\.php\?category=([^&]+)&section=([^\ ]+)\ HTTP/$
RewriteRule ^topics\.php$ topics/%1/%2 [R=301,L]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /topics\.php\?category=([^\ ]+)\ HTTP/$
RewriteRule ^topics\.php$ topics/%1 [R=301,L]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /topics\.php\ HTTP/$
RewriteRule ^topics\.php$ topics [R=301,L]

RewriteCond %{REQUEST_URI} ^/(urllist|sitemap).*$
RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ forums/vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]

RewriteCond %{REQUEST_URI} !^/forums/.*$
RewriteCond %{REQUEST_URI} ^/forum.*$ [NC,OR]
RewriteCond %{REQUEST_URI} ^/old_site_v./forum.*$
RewriteRule ^(.*)$ [virtualteen.org...] [R=301,L]

RewriteCond %{REQUEST_URI} !^/forums/.*$
RewriteCond %{REQUEST_URI} !^/old_site_v./.*$
RewriteCond %{QUERY_STRING} ^page=([^&]+)$ [OR]
RewriteCond %{REQUEST_URI} ^/aacap_(.+)\.shtml$
RewriteRule ^(.*)$ [virtualteen.org...] [R=301,L]

RewriteCond %{REQUEST_URI} !^/forums/.*$
RewriteCond %{REQUEST_URI} ^/help.*$ [NC]
RewriteRule ^(.*)$ [virtualteen.org...] [R=301,L]RewriteCond %{HTTP_REFERER} !^http://virtualteen.org/.*$ [NC]

g1smd

1:48 am on Mar 13, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The code is almost impossible to read. You need to use example.com and then the forum will not auto-link the URLs.

There are a large number of problems with the code.

You need to list redirects which affect only a single URL first, then redirects which affect a small number of URLs, then the index to slash redirect, then the non-www to www redirect. This avoids some requests creating an unwanted redirect chain.

Redirects (rules with [R=301,L] flags) should include the protocol and the domain name in the redirect target.

The rewrites (those with the [L] flag) should be listed last.

Trailing .*$ patterns which are not captured in a backreference are superfluous and can be deleted.

Look closely at the last two lines of your post. There's a CR/LF missing for sure. Is it like that in your .htaccess file too?

RewriteCond patterns ending with HTTP/$ will never match a real request, because a real request will end HTTP/1.0 or HTTP 1.1 etc. Delete the $ symbol.

Sort all of those out and post again. There may yet be other issues.