LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 01-20-2010, 03:31 PM   #1
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,461
Blog Entries: 6

Rep: Reputation: 51
Need help with apache Rewrite Rule?


Web Server: apache
Machine: RHEL 5.2
I'm setting up a rewrite rule which has the following scenario:

I have a url : devmob.stariance.com which needs to be pointed to index.html file which is in document root.Whereas, in the index.html file i'm redirecting to a new index.jsp file which is available in the same document too.

So, the index.html contents are :
Code:
<meta http-equiv="refresh" content="0;URL=http://devmob.stariance.com/index.jsp">
Can you anyone provide me the redirect/rewrite rule which i can specify in apache which would directly take me the index.jsp file?

currently, i have added the following entries :
Code:
RewriteCond %{HTTP_HOST} ^devmob\.stariance\.com [NC]
RewriteRule  devmob.stariance.com  http://devmob.stariance.com/index.html [PT,NC,L]
I have also setup a virtual host which can run on port 82 for this url.
Code:
<VirtualHost *:82>
DocumentRoot /data/apache/htdocs/mobapp/
ServerName devmob.stariance.com
#DirectoryIndex /mobapp/jsp
DirectoryIndex index.html
JkMount /*  node1
JkMount /hottopics* node1
JkMount /mobapp* node1
Include conf/Rewrite.conf
</VirtualHost>


Pls Suggest.
 
Old 01-21-2010, 08:12 AM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650
Why do a rewrite rule ? ... just change to :

Code:
DirectoryIndex index.jsp
<edit>just realised you'd set up vhost on a non-standard port.. do you need to ?</edit>

cheers

Last edited by kbp; 01-21-2010 at 08:14 AM.
 
  


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
Linux Apache Rewrite Rule jon_k Linux - Software 1 06-10-2009 03:09 AM
apache rewrite rule to lighttpd's. error!!! gavin2u Linux - Server 0 08-12-2008 01:18 AM
Subdomains with Apache 2.2.3 - vhost or rewrite rule? Serapis Linux - Server 8 01-25-2008 05:28 AM
Apache rewrite rule help kinetik Linux - Software 1 11-05-2007 12:18 PM
Help me make this rewrite rule in Apache ganninu Linux - General 8 01-07-2004 09:30 AM


All times are GMT -5. The time now is 02:36 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration