LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 07-30-2012, 12:33 AM   #1
hahaso
LQ Newbie
 
Registered: Nov 2011
Posts: 4

Rep: Reputation: Disabled
How to redirect folder to a url in .htaccess


I'm trying to redirect a folder and all its sub files to a URL in .htaccess file.

But
Code:
Redirect 301 /abc/cba/ http://www.new.com/
only redirect
Code:
 http://www.old.com/abc/cba/
to
Code:
http://www.new.com/
, sub files like
Code:
/abc/cba/ddd/
is redirected to
Code:
http://www.new.com/ddd/
instead of
Code:
http://www.new.com/
Could anyone help? Thanks.

Last edited by hahaso; 07-30-2012 at 12:34 AM.
 
Old 07-30-2012, 12:43 AM   #2
hahaso
LQ Newbie
 
Registered: Nov 2011
Posts: 4

Original Poster
Rep: Reputation: Disabled
Here comes the answer:

Code:
RedirectMatch 301 ^/abc/cba/ http://www.aaa.com/
 
  


Reply

Tags
htaccess


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
Redirect with htaccess chandranjoy Linux - Server 1 02-16-2011 07:40 AM
Cannot Redirect URL to another URL when the link is down with Squid marx_long Linux - Newbie 1 06-13-2010 08:59 PM
.htaccess to redirect all requests to another URL agflem Linux - Newbie 1 04-16-2010 10:38 AM
Apache htaccess redirect Jorkim Kustafin Linux - Server 2 07-23-2009 12:32 PM
Htaccess with a redirect Diode Linux - Networking 0 10-28-2003 06:23 PM


All times are GMT -5. The time now is 04:49 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