LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-31-2015, 06:30 AM   #1
swathi.akkineni
LQ Newbie
 
Registered: Sep 2012
Location: Hyderabad
Posts: 3

Rep: Reputation: Disabled
Unhappy Why am I not able to redirect using htaccess. It says too many redirect rules.


My Requirement is
1. If I enter mydomain.com or www.mydomain.com, it should redirect to http://www.mydomain.com/site/public/home.jsp
2. I also have mantis installed in apache root folder. So, If I enter mydomain.com/mantibt it should take me to mantis login page.


I placed a htaccess file with the below content.

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond {HTTP_HOST} ^mydomain.com$ [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/site/public/home.jsp [L,R=301]
RewriteCond %{HTTP_HOST} ^www.mydomain.com$ [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/site/public/home.jsp [L,R=301]
RewriteRule ^mantisbt/(.*)$ http://mydomain.com/mantisbt/$1 [R=301,L]
</IfModule>


Please let me know what is missing

Last edited by swathi.akkineni; 07-31-2015 at 06:31 AM. Reason: miss typo
 
Old 07-31-2015, 03:20 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
hi,

You don't need the following part:
Quote:
RewriteCond %{HTTP_HOST} ^www.mydomain.com$ [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/site/public/home.jsp [L,R=301]
Regards
 
  


Reply

Tags
apache, htaccess, rewriterule



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
Help me please make this htaccess redirect Chiba Linux - Software 0 10-11-2014 07:54 PM
How to redirect to three different domains with .htaccess? plotinus Linux - Server 2 11-24-2011 12:38 AM
Redirect with htaccess chandranjoy Linux - Server 1 02-16-2011 07:40 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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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