LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 09-27-2012, 02:57 PM   #1
figure20012
Member
 
Registered: Apr 2012
Posts: 75

Rep: Reputation: Disabled
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/
 
Old 09-27-2012, 04:58 PM   #2
rosehosting.com
Member
 
Registered: Jun 2012
Posts: 222

Rep: Reputation: 62
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
 
1 members found this post helpful.
Old 09-27-2012, 10:32 PM   #3
figure20012
Member
 
Registered: Apr 2012
Posts: 75

Original Poster
Rep: Reputation: Disabled
thanks a lot rosehosting you save my life

Quote:
Originally Posted by rosehosting.com View Post
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
 
  


Reply

Tags
apache, rewritecond, rewriterule


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] htaccess remove www for subdomain and add www for main domain conflicker Programming 7 07-18-2012 06:23 PM
Apache no-www to www domain rewrite after upgrade deesto Linux - Server 5 06-20-2012 12:16 PM
redirect https://www.domain.com to https://domain.com decenter Linux - Server 4 09-13-2011 10:05 AM
Apache https redirect without-www to with-www alitrix Linux - Server 3 07-24-2008 06:11 AM
redirect user.domain.com to www.domain.com/user macadam Linux - Newbie 2 05-15-2008 01:07 PM


All times are GMT -5. The time now is 06:15 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration