Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Hi when I try to make 301 redirect I get an internal error code 500:

Rewriterule ^categoy/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)? product_detail.php?category=$1&subcategory=$2&product=$4 [QSA,NC]

RewriteMap fiel:

RewriteMap lc int:tolower
RewriteCond %{REQUEST_URI} [A-Z]
RewriteRule (.*) ${lc:$1} [R=301,L]

any suggestion why I get this error ?

thanks

share|improve this question

3 Answers 3

When you get a 500 error from Apache, Apache will make a note of why it gave you that error in your error_log, wherever that is configured to go. Refer to the error message in that log to find out what you're doing wrong.

share|improve this answer

RewriteMap directives aren't allowed within .htaccess file. It should be written in Apache's configuration file httpd.conf.

share|improve this answer

okay... lets get some things straight.

Rewriterule ^categoy/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)? product_detail.php?category=$1&subcategory=$2&product=$4 [QSA,NC]

theres a lot of redundant stuff in here as for example NC does case insensitive matching anyway.. i formatted your code a bit:

RewriteMap lc int:tolower 
RewriteCond %{REQUEST_URI} [A-Z] 
RewriteRule (.*) ${lc:$1} [R=301,L]

which rule are you talking about now? from your title (301) i think the second one. your rewritecondition looks weird. but however the most common reason for an error 500 in relation to rewrite rules is lacking permissions. make sure you do AllowOverride All in your server config or move your rules there (which gives more performance than in htaccess files)

share|improve this answer
    
thanks alot Joe Hopfgartner will check and get back to you –  Welliam Sep 11 '10 at 22:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.