.htaccess - Rewrite only one specific url -


i want rewrite 1 specific url.

http://example1.com should http://example2.de .

but http://example1.com/subdir or http://sub.example1.com should remain same.

i found following, rewrites example1.com, every url starts example1.com

options +followsymlinks  rewriteengine on  rewritecond %{http_host} ^example.com [nc]  rewriterule ^(.*)$ http://www.example.com/$1 [l,r=301] 

background: want redirect main page of wp-multisite want make sure can work backend of wordpress , run other multisites subdomains.

you're pretty close don't need capture uri in $1:

options +followsymlinks -multiviews # turn mod_rewrite on rewriteengine on  rewritecond %{http_host} ^(www\.)?example1\.com$ [nc] rewriterule ^$ http://example2.de/ [l,r=301] 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -