.htaccessisapi-rewrite

.htaccess redirect is not working


Running into any issue where my redirect is not firing... This is isapi rewrite 3.0

original domain: http://sub.main.com/asdf/asdff/index.php?/asdfff/14/asdffff-540-a-s-d-f-f/

New domain: http://newsub.newmain.com/a-s-d-f-f/ (quick edit - was missing the final -f from the above original domain)

htaccess:

RewriteCond %{HTTP_HOST} ^sub\.main\.com$
RewriteRule ^\/asdf\/asdff\/index.php\?\/asdfff\/(.+)\/asdffff-(.+)-?$ http://newsub.newmain.com/$1/ [L,R=301]

Solution

  • CBroe Thank you.

    Just so everyone knows what I ended up with was below:

    RewriteCond %{HTTP_HOST} ^sub.domain.com$

    RewriteCond %{QUERY_STRING} /asdfff/(.+)/asdffff-(.+?)-(.+)

    RewriteRule ^/asdf/asdff/ http://newsub.newmain.com/%3?

    Thanks again.

    City