RewriteRule without flag R

Go To StackoverFlow.com

0

Why this rule:

RewriteRule ^(.*)/([1-9]+)[^/]$ /$1/?utm_source=$2 [R,L]

work with R flag and without it doesn't work. What's the problem ?

2012-04-04 23:10
by enfix


1

Because without the R flag it's internal rewrite, it's not an actual redirect.

You can do some search on your own:

Two hints to help you doing the job faster:


Please try to use the RewriteLog directive: it helps you to track down problems:

# Trace:
# (!) file gets big quickly, remove in prod environments:
RewriteLog "/web/logs/mywebsite.rewrite.log"
RewriteLogLevel 9
RewriteEngine On

My favorite tool to check for regexp:

http://www.quanetic.com/Regex (don't forget to choose ereg(POSIX) instead of preg(PCRE)!)

You use this tool when you want to check the URL and see if they're valid or not.

2012-04-05 07:17
by Olivier Pons
Ads