LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   want to redirect www.domain.com/folder www.domain100.com (http://www.linuxquestions.org/questions/linux-newbie-8/want-to-redirect-www-domain-com-folder-www-domain100-com-4175429341/)

figure20012 09-27-2012 03:57 PM

want to redirect www.domain.com/folder www.domain100.com
 
how can i redirect www.domain.com/folder to www.domain100.com using rewriterule and rewrite cond

RewriteCond %{HTTP_HOST} (^/folder$)
RewriteRule (.*) http://www.domain100.com/ [R=301,L]


folder1 also redirects to www.domain100.com.Can someone please help me i want only folder to redirect to http://www.domain100.com/

only www.domain.com/folder to redirect to http://www.domain100.com/

rosehosting.com 09-27-2012 05:58 PM

You can achieve this by using a 301 redirect. For example:

Code:

RewriteEngine on
Redirect 301 /folder http://www.domain100.com

or another way of doing it would be:

Code:

RewriteEngine on
RewriteCond %{REQUEST_URI} ^/folder/
RewriteRule ^(.*)$ http://www.domain100.com [L]

HTH

figure20012 09-27-2012 11:32 PM

thanks a lot rosehosting you save my life :)

Quote:

Originally Posted by rosehosting.com (Post 4791038)
You can achieve this by using a 301 redirect. For example:

Code:

RewriteEngine on
Redirect 301 /folder http://www.domain100.com

or another way of doing it would be:

Code:

RewriteEngine on
RewriteCond %{REQUEST_URI} ^/folder/
RewriteRule ^(.*)$ http://www.domain100.com [L]

HTH



All times are GMT -5. The time now is 08:26 PM.