LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 04-09-2010, 01:38 PM   #1
bax
Member
 
Registered: Dec 2001
Location: NoVA
Distribution: Ubuntu, Solaris, OpenBSD
Posts: 492

Rep: Reputation: 30
Redirect https apache requests to folder not in apache root


I want to redirect requests for example.com/CFIDE to one folder above the Apache root. How should I go about this? Doesn't look like htaccess rewrites are designed to do this.
 
Old 04-09-2010, 03:12 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
I want to redirect requests for example.com/CFIDE to one folder above the Apache root
I guess you mean a directory above docroot. Anyway to be able to use a directory that is not under docroot, you should use an Alias:
Code:
Alias /foo /path/to/foo
and the use mod_rewrite:
Code:
RewriteRule ^CFIDE /foo
 
Old 04-09-2010, 03:51 PM   #3
bax
Member
 
Registered: Dec 2001
Location: NoVA
Distribution: Ubuntu, Solaris, OpenBSD
Posts: 492

Original Poster
Rep: Reputation: 30
I edited the htaccess in the doc root to read:

Alias /CFIDE /PathToActualFolder/CFIDE

and added RewriteRule ^CFIDE /CFIDE to httpd.conf. I'm sure I'm misinterpreting something as it's still not working.
 
Old 04-09-2010, 04:04 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
The Alias directive goes into httpd.conf or inside a vhost definition, but not in .htaccess.
In your case you don't even need the rewrite rule, as the Alias name is the same as the subdirectory name. Just use in httpd.conf
Code:
Alias /CFIDE /PathToActualFolder/CFIDE
 
Old 04-12-2010, 01:16 PM   #5
bax
Member
 
Registered: Dec 2001
Location: NoVA
Distribution: Ubuntu, Solaris, OpenBSD
Posts: 492

Original Poster
Rep: Reputation: 30
Thank you bathory, worked perfectly!
 
  


Reply



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] Apache: Redirect to root Spetnik Linux - Server 3 03-25-2010 10:40 AM
How do you properly redirect all web client requests from http to https? mehoggan Linux - Server 4 06-02-2009 03:49 AM
Apache root folder access j.gonsalves Linux - Newbie 1 03-22-2009 06:02 AM
Apache https redirect without-www to with-www alitrix Linux - Server 3 07-24-2008 06:11 AM
Apache & Squirrelmail:Redirect to https? mac_phil Linux - Software 1 05-24-2004 03:52 AM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 05:03 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration