LinuxQuestions.org
Visit Jeremy's Blog.
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 01-07-2010, 06:42 PM   #1
Samael
Member
 
Registered: Oct 2008
Location: England
Distribution: Ubuntu and Fedora (64-bit)
Posts: 81

Rep: Reputation: 16
Apache htaccess is doing my nut in


I've been struggling with this for ages. Basically on my site I have a wildcard SSL with following subdomain:

forum.domain.com

As usual domain.com goes to a folder such as public_html. I've used the Apache config to direct forum.domain.com to public_html/forum.

It works fine but I want to put an htaccess in public_html/forum that will cause www.domain.com/forum to be rewritten as forum.domain.com

I've found various means of doing this online but they always have something like this:

Code:
RewriteCond %{HTTP_HOST}   !^forum\.domain\.com [NC]
RewriteCond %{HTTP_HOST}   !^$
RewriteRule ^/(.*)         http://forum.domain.com/$1 [L,R]
I can't use this though as I need it to work for both http and https. Any ideas?
 
Old 01-08-2010, 07:05 PM   #2
fang0654
Member
 
Registered: Oct 2003
Location: New York, NY
Distribution: Ubuntu
Posts: 110

Rep: Reputation: 28
Can you just use virtual hosts?

AKA domain.com points to public_html, whereas the forum area has its own folder, with its own config for forum.domain.com.

Here is a relatively simple tutorial on how to set up virtual hosts:

http://www.debian-administration.org/articles/412
 
Old 01-09-2010, 12:23 PM   #3
Samael
Member
 
Registered: Oct 2008
Location: England
Distribution: Ubuntu and Fedora (64-bit)
Posts: 81

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by fang0654 View Post
Can you just use virtual hosts?
I have done:
"As usual domain.com goes to a folder such as public_html. I've used the Apache config to direct forum.domain.com to public_html/forum."

My post is in regards to the fact that it's still possible to use domain.com/forum/ to view the forum, whereas I only want it viewable by the other method forum.domain.com which will require an htaccess rewrite rule which works from the forums directory onward.
 
  


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
Apache 2 .htaccess 0.o Linux - Server 12 02-15-2008 02:41 PM
Apache 2.0.52 and .htaccess ZC1 Linux - General 3 05-20-2006 10:38 AM
Fedora Apache drive me nut hct224 Linux - Newbie 6 10-07-2004 01:22 AM
is htaccess on apache 2.0 not the same as in 1.3 abd_bela Linux - General 3 07-23-2003 05:17 AM
.htaccess in apache 2 im1crazyassmofo Linux - Software 1 04-04-2003 01:50 AM

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

All times are GMT -5. The time now is 11:02 AM.

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