apache - .htaccess poiting a domain to another domain/directory -


i need modify .htaccess file can override domain. first tell don't know .htaccess file. , there lot of stuff in .htaccess file.

what want redirect

www.one-domain.com 

to

www.second-domain.com/abc 

i don't want else change. one-domain.com start showing content of second-domain.com/abc

between both sites domain of wordpress.

one-domain.com content @ root/ second-domain.com content @ root/direcoty

below content of .htaccess file has.

# -frontpage- indexignore .htaccess */.??* *~ *# */header* */readme* */_vti* <limit post> order deny,allow deny allow </limit> <limit put delete> order deny,allow deny </limit> <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule> # begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule> # end wordpress # begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule> # end wordpress # begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule> # end wordpress # begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule> # end wordpress # begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule> # end wordpress 

insert code below rewritebase line:

rewritecond %{http_host} ^(www\.)?one-domain\.com$ [nc] rewriterule ^$ http://www.second-domain.com/abc [l,r=301] 

also note block repeating multiple times:

# begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule> 

you need have block once in .htaccess


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -