Welcome to WebmasterWorld Guest from 54.224.50.28

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Need some help with bad flag delimiters

500 error

     
3:15 pm on Apr 9, 2014 (gmt 0)

New User

10+ Year Member

joined:July 10, 2005
posts: 4
votes: 0


Hi everybody,

I am trying to install as script but to no avail. The error shows me the bad flag error. Is there someone who can take a look at it and help me out. I am a total noob when it comes to htaccess

Here is the code

# Turn off directory browsing
# Options -Indexes # Start the rewrite engine
RewriteEngine On # Make sure the user included www.
RewriteCond %{HTTP_HOST} ^subdomain.mydomain.com
RewriteRule ^(.*)$ http://www.subdomain.mydomain.com/$1 [r=301,L] # Compress the stylesheet
RewriteRule ^([^/]+).css$ classes/CompressStyles.php?sheet=$1 # Give pages pretty URLs
RewriteRule ^([0-9a-zA-Z\-]+)$ $1.php # Lame and Juicy buttons
RewriteRule ^([0-9a-zA-Z\-\\/]*)lame/([0-9]+)$ rate.php?value=-1&secretID=$2
RewriteRule ^([0-9a-zA-Z\-\\/]*)juicy/([0-9]+)$ rate.php?value=1&secretID=$2

# View comments
RewriteRule ^view/([0-9]+)$ comments.php?secretID=$1

# Delete comment
RewriteRule ^([0-9a-zA-Z\-\\/]*)delete-comment/([0-9]+)$ delete-comment.php?commentID=$2 # Delete entry
RewriteRule ^([0-9a-zA-Z\-\\/]*)delete-entry/([0-9]+)$ delete-entry.php?secretID=$2

# Edit entry
RewriteRule ^([0-9a-zA-Z\-\\/]*)edit-entry/([0-9]+)$ edit-entry.php?secretID=$2

# View category
RewriteRule ^view/([a-zA-Z\-]+)$ view-category.php?category=$1

# Pagination
RewriteRule ^([0-9a-zA-Z\-]+)/page([0-9]+)$ $1.php?page=$2
RewriteRule ^view/([0-9\-]+)/page([0-9]+)$ comments.php?secretID=$1&page=$2
RewriteRule ^view/([a-zA-Z\-]+)/page([0-9]+)$ view-category.php?category=$1&page=$2
RewriteRule ^page([0-9]+) index.php?page=$1
RewriteRule ^search/([0-9a-zA-Z\-\%\+]+)/page([0-9]+)$ search.php?query=$1&page=$2

# Secret submission
RewriteRule ^thank-you upcoming.php?submitted=true

# Admin Page
RewriteRule ^([0-9a-zA-Z\-\\/]*)admin admin/index.php

# Button clicking
RewriteRule ^images/buttons/([0-9a-zA-Z\-]+).png$ classes/Button.php?text=$1

# Mask all XML files as PHP pages
RewriteRule ^(.+).xml $1.php

# Page not found
ErrorDocument 404 /page-not-found


Thanks a lot for your time
6:22 pm on Apr 9, 2014 (gmt 0)

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:11031
votes: 96


The error shows me the bad flag error.


where are you seeing this error?
8:22 pm on Apr 9, 2014 (gmt 0)

New User

10+ Year Member

joined:July 10, 2005
posts: 4
votes: 0


In the error log
8:31 pm on Apr 9, 2014 (gmt 0)

Administrator from US 

WebmasterWorld Administrator not2easy is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Dec 27, 2006
posts:3451
votes: 181


The list posted here does not show any flags, that is probably one of the problems, but you say you are trying to run this as a script, so maybe you have something else to set a default? Just wild guessing. It helps to get info about other environment variables that are involved.

[r=301,L] is the only flag I see and only affects one rule. The default redirect is a 302, so if you want 301 you need to add a flag like the one shown where it results in a redirect.

BTW, for your own future updates, it is best to have your commented lines on their own line and to leave a space between rules so your file is easier to read - unless your script requires this format. It would look like this:

RewriteRule ^(.*)$ http: //www.subdomain.example.com/$1 [r=301,L]

# Compress the stylesheet
RewriteRule ^([^/]+).css$ classes/CompressStyles.php?sheet=$1

# Give pages pretty URLs
RewriteRule ^([0-9a-zA-Z\-]+)$ $1.php

# Lame and Juicy buttons
RewriteRule ^([0-9a-zA-Z\-\\/]*)lame/([0-9]+)$ rate.php?value=-1&secretID=$2

(Please ignore the extra space in the first rule listed - done to keep it from linking to an error)
9:31 pm on Apr 9, 2014 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:14157
votes: 541


it is best to have your commented lines on their own line

That's what's triggering the (slightly misleading) "bad flag" error lines. Apache expects to find a flag in this location, and instead finds a #.

Been there. Done that.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members