Error while Redirecting page using mod rewrite in apache
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Error while Redirecting page using mod rewrite in apache
Hi,
i had configured apache and tomcat its started and works well.i had placed index.jsp in apache-tomcat-6.0.26/webapps/ROOT/jsp/wip/index.jsp folder..how can i redirect /jsp/wip/index.jsp to listen to tomcat page using mod rewrite .i had enabled mod_rewrite module in apache http.conf file .i could int able to redirect /jsp/wip/index.jsp to tomcat page automatically http://65.23.87.xx:8080.can someone help me how can enable it
It's better not to use mod_rewrite and use apache as a reverse proxy for tomcat.
For this you'll need mod_proxy_ajp (or mod_jk that is an external apache module)
Check this out that is describing both methods
First of all your Redirect is wrong.
2nd, I guess you didn't read my previous post. You need mod_proxy or mod_jk for this, because it's better to hide tomcat running as the backend server.
With mod_rewrite, e.g using:
Code:
RewriteEngine On
RewriteRule jsp/wip/index.jsp http://65.23.87.xx:8080
when someone visits http://bmw.etl.com/jsp/wip/index.jsp he gets redirected externally to http://65.23.87.xx:8080, so he can see that url in the browsers location bar..
With mod_proxy instead, the url is not changing. So better take a look at the link in my previous post and use mod_proxy/mod_proxy_ajp or mod_jk
but i could in divert tha page http://bmw.etl.com:8080/jsp/wip/index .rewrite rule which i was written was when ever apache page hit / it should want to divert it to tomcat /ROOT/webapps/jsp/b2c/index.jsp
This isn't going to work, because in the RewriteRule you can rewrite a URL (what starts with http://), but a URI (that's a path, like /blah/index.html)
Anyway, I don't fully understand what you want to do, but if you want any request for http://bmw.etl.com to get redirected to tomcat's index.jsp (but not in the fashion of a reverse proxy), then you need this:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.