More .htaccess help

I can’t seem to create a .htaccess file that doesn’t result in a 500 error. I have uploaded it using ASCII mode. I set the permissions to 644 - and I have the following line in the file:

redirect /home/user/

What am I doing wrong? Is my syntax wrong? Am I not pointing to the user directory correctly?

Do I need this at the beginning of the file?

File: /home/user/

Nothings seems to work.

Syntax is your problem. What are you trying to do? Create a redirect rule based on going to a select page?

Try this:

RewriteEngine On
RewriteRule ^file.html$ [R]

So - I need all of that in the .htaccess file?

Sorry - tres new on this one.

what is: ^file.html

Do I need the full path to the user account? Or does that not matter?

RewriteEngine On
RewriteRule ^file.html$ [R]

^file.html$ is pattern matching; Starts with ‘f’ and ends with ‘l’ with the letters in between being in that order.

You could get away with file.html, too.

And yes, you need both them lines. You gotta first tell Apache you’re turning on the RewriteEngine and then you supply your rules.

Redirect uses URI paths, not filesystem paths. That is, all paths should be relative to the root of the web site. The following is the correct syntax:

Redirect /file.html Don’t incur the overhead of mod_rewrite unless you actually need it (you don’t).

If you want useful replies, ask smart questions.

Thanks so much. I’m going to try this in the morning - I’ll let you know how it goes.

The first one - in the root of the web server is working - meaning the first redirect.

How do I tell the .htaccess to go one directory down and redirect in the same file?

RewriteEngine On
RewriteRule ^rss.xml$ [R]
RewriteRule ^/fastfoodfever/rss.xml$ [R]

The second fast food fever one is not working.

In .htaccess files, the per-directory prefix is removed when the pattern is matched for the RewriteRule directive. This means:

RewriteRule ^/fastfoodfever/rss.xml$ [R]is incorrect because you have a slash that should not be there. It should be:

RewriteRule ^fastfoodfever/rss.xml$ [R]In other words,

Given /path/.htaccess, the prefix is /path/

Step 1. Remove prefix
/path/fastfoodfever/rss.xml -> fastfoodfever/rss.xml
Step 2. Match pattern
^fastfoodfever/rss.xml$ matches fastfoodfever/rss.xml

Aslo, technically the pattern should be ^fastfoodfever/rss.xml$ - note that the period in a pattern has a special meaning; it matches “any character”. If you don’t put a backslash in front of the period, then a URL like this:
would still cause the redirect, because the period would match the T.

Also, using the RewriteEngine for this situation is overkill. You can do the same thing with

Redirect /rss.xml Redirect /fastfoodfever/rss.xml that you don’t need pattern matching and conditions.

:cool: Perl / MySQL / HTML+CSS