LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-16-2009, 01:28 PM   #1
Echo Kilo
Member
 
Registered: Jul 2004
Distribution: Ubuntu - Debian Based
Posts: 242

Rep: Reputation: 30
Redirecting using Apache and .htaccess


Hello:

I am trying to redirect from the page: thesolarforum.com/forum

to the new forum at thesolarforum.com/mm-forum

But, I can't seem to figure out what's wrong with my code in the .htaccess file

RewriteCond %{HTTP_HOST} ^thesolarforum.com\forum$ [OR]
RewriteCond %{HTTP_HOST} ^www.thesolarforum.com\forum$
RewriteRule ^$ "http\:\/\/www\.thesolarforum\.com\/mm-forum/listcat\/" [R=301,L]

Oh, I'm a novice so please consider that with suggestions.
 
Old 07-16-2009, 02:22 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,159
Blog Entries: 1

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
First you need a
Code:
RewriteEngine on
unless you already have it in httpd.conf.
Then in the RewriteCond you should use REQUEST_URI instead of HTTP_HOST, and also the backslashes are wrong:
Then you need a "^(.*)" (means everything) in the RewriteRule. Also there is no need to escape every special character.
So try the following and see if it works:
Code:
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/forum
RewriteRule ^(.*) http://www.thesolarforum.com/mm-forum/listcat [R=301,L]
 
Old 07-16-2009, 02:27 PM   #3
Echo Kilo
Member
 
Registered: Jul 2004
Distribution: Ubuntu - Debian Based
Posts: 242

Original Poster
Rep: Reputation: 30
Thank you - that worked like a charm!!!
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apache server redirecting to apache.org? exley Linux - Software 1 03-13-2006 01:02 AM
htaccess not redirecting? mikeindo Linux - Networking 10 01-18-2006 09:00 AM
htaccess not redirecting? mikeindo Other *NIX 1 01-13-2006 03:15 PM
apache redirecting mardanian Linux - Networking 1 04-14-2004 06:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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