.htaccess - Htaccess url redirecting error -


i have following structure in htaccess file. issue if uri matches condition url redirect according rule , if uri doesn't match default rule should apply, please tell me how fix.

first rule: redirectmatch 301 /mob/(.*) http://www.newdomain.com/price/$1

default rule: redirectmatch 301 /(.*) http://www.newdomain.com/$1

when tried default rule overriding other rules.

assuming both domains on same root folder , host:  rewritecond %{http_host} ^originaldomain\.com$ rewritecond %{request_uri} ^/cms rewriterule ^(.*)$ https://differentdomain.com/$1 [l,r=302] if not on same root , folder:  rewritecond %{request_uri} ^/cms rewriterule ^(.*)$ https://differentdomain.com/$1 [l,r=302] 2nd part if url not act, url, system or post:  rewritecond %{the_request} !^[a-z]{3,}\s/(act\?(.*)|url|system)$ [nc] rewritecond %{the_request} !^post [nc] rewriterule ^(.*)$ http://originaldomain.com/$1 [l,r=302] should work, if after test change 302 301 if needed. 

Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -