LinuxQuestions.org
Review your favorite Linux distribution.
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, 02: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, 04:12 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,910

Rep: Reputation: 1890Reputation: 1890Reputation: 1890Reputation: 1890Reputation: 1890Reputation: 1890Reputation: 1890Reputation: 1890Reputation: 1890Reputation: 1890Reputation: 1890
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, 04: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, 05:04 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,910

Rep: Reputation: 1890Reputation: 1890Reputation: 1890Reputation: 1890Reputation: 1890Reputation: 1890Reputation: 1890Reputation: 1890Reputation: 1890Reputation: 1890Reputation: 1890
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, 02: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


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

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

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