RewriteRule not working
15,457
Solution 1
Apache must have complained about:
RewriteRule: bad flag delimiters
Remove the white space in your flags. Change this:
[R=301, L]
to:
[R=301,L]
Note: if you're using the rule inside a per-directory htaccess file, you need to omit the leading slash:
RewriteRule ^taxonomy/term/([0-9]+)$ http://www.example.com/taxonomy/term/$1 [R=301,L]
Solution 2
Remove the beginning slash:
RewriteRule ^taxonomy/term/([0-9]+)$ http://www.example.com/taxonomy/term/$1 [R=301, L]
Author by
LazyD
Updated on June 04, 2022Comments
-
LazyD almost 2 years
I am trying to add a rewrite rule in my
httpd.conf
file but it's not working.Here's the relevant section:
RewriteRule ^/taxonomy/term/([0-9]+)$ http://www.example.com/taxonomy/term/$1 [R=301, L]
Currently, my site name is www.domain.com and I am trying to redirect all the URLs starting with
taxonomy/term/{integer}
to my new domain www.example.com through anhttpd.conf
RewriteRule
. -
LazyD almost 13 yearsHi John, thanks for your inputs. i have already tried that but not working :(
-
LazyD almost 13 yearsi was unable to restart the services after the above mentioned changes?
-
LazyD almost 13 yearsAre u aware of some online site wherein we can quickly check the same?
-
Salman A almost 13 yearsI'm not aware of any website that allows you to tamper with .htaccess files :) But this website might help.
-
LazyD almost 13 yearsThanx Salman... But this site no were states the error.. as u have pointed out above "RewriteRule: bad flag delimiters"..
-
Salman A almost 13 yearsHmmm, the website probably cannot tell if your htaccess or conf file is OK. The error I mentioned was logged in Apache logs; it is the first place you should look when you see the dreaded 500 Internal Server Error.