Forum Moderators: phranque
i have to a simple Redirect 301
but i don't be able to match the trailing slash!
:-(
[domain1...]
i have to redirect to
[domain2...]
my rewriting
RewriteRule %{HTTP_HOST} ^domain1$
RewriteRule ^categoria/soppalchi-9/?$ [domain2...] [R=301,L]
but not works :o(
i try with various regexp
soppalchi-9/?
soppalchi-9(/).
soppalchi-9\/?
soppalchi-9//?
without success :o(
if a remove the last slash in url (categoria/soppalchi-9/) it works!
can anyone help me?
many thanks
Roberto
RewriteRule %{HTTP_HOST} ^domain1$
RewriteRule ^categoria/soppalchi-[b]9/$[/b] http://domain2/categoria/soppalchi-9/ [R=301,L]
Jim
thanks for your reply.
you're right: i'm another RewriteRule that match the regexp.
if i write:
RewriteCond %{HTTP_HOST} ^domain1$
RewriteRule ^categoria/soppalchi-9/?$* [domain2...]
RewriteRule ^categoria\/(.*)-([0-9]+)/ catalogo/index.cfm?gr=$2
don't match.. :o(
if i invert the rules
RewriteRule ^categoria\/(.*)-([0-9]+)/ catalogo/index.cfm?gr=$2
RewriteCond %{HTTP_HOST} ^domain1$
RewriteRule ^categoria/soppalchi-9/?$* [domain2...]
the webpage has a redirect loop :o(
any idea?
many thanks
Rob
You also need to investigate the other two settings I mentioned. I can't help you if you don't take the suggested actions.
Your internal rewrite rule pattern needs an end-anchor and should have an [L] flag on it. And further, it may need a RewriteCond to qualify it by checking for HTTP_HOST = domain2. I can't be sure about this latter point, because I don't know if both domains are co-hosted in this same filespace.
Jim