Currently I am using a rewrite that looks something like this RewriteRule ^(.*)-(.*)$ index.php?c=$1&s=$2 Code (markup): I notice other people on this forum ending the line with [L], or [R=301]., like in the following line RewriteRule ^(.*)-(.*)$ index.php?c=$1&s=$2 [L] Code (markup): or RewriteRule ^(.*)-(.*)$ index.php?c=$1&s=$2 [R=301] Code (markup): or both Is there a difference or a reason for this? thanks
i think (but not sure) [L] would give a 401 un authorised error and [R=301] would re-direct the visiter
Use both... [L,R=301] [L] just means it's the last one, so it can stop looking for more rewrite rules if one matches that one.
just found a cool cheat sheat that you can use for fyture reference http://www.ilovejackdaniels.com/mod_rewrite_cheat_sheet.png
Ok [L] is simply an optimization, and [R=301] means it is a permanent redirect. But what if I didnt specify the [R=301]? Does it return some type of other response code? Is is really better from a search engine perspective include the [R=301] part? (From a users perspective there is no difference that I can see)
It appears to me if I use a 301 redirect, the new url becomes visible in the browser url bar..(not what I want) If I wish to use mod_rewrite to make the urls shorter, shoult I then use a 302 redirect? I am really confused now.
You don't need R at all. From what I understand, all you are after is SE-friendly urls which is what mod_rewrite can be used for without R directive. You'd use redirects (301 or 302) only if your pages actually changed locations and you needed to inform the search engines and site users about the change.