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 http://65.23.87.xx/jsp/wip/index.jsp to http://65.23.87.xx:8080 vi/etc/httpd/httpd.conf find: #LoadModule rewrite_module modules/mod_rewrite.so LoadModule rewrite_module modules/mod_rewrite.so Saved the chages changes service httpd restart Regards arun |
Hi,
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 Regards |
Hi
I had enabled the mod rewrite module in httpd.conf LoadModule rewrite_module modules/mod_rewrite.so Redirect http://bmw.etl.com/jsp/wip/index.jsp http://bmw.etl.com but still /jsp/wip/index.jsp never redirecting to bmw.etl.com im very new to apache can someone help me out what wrong im making in redirecting url Regards arun |
Hi,
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 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 Regards |
Thanks for ur help i got solved
|
Hi
how can divert tomcat page http://bmw.etl.com:8080/jsp/wip/index.jsp http://bmw.etl.com 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 RewriteEngine on RewriteLogLevel 12 RewriteLog /etc/httpd/logs/rewrite.log RewriteCond %{HTTP_HOST} ^bmw.etl.com$ RewriteRule http://bmw.etl.com/ http://bmw.etl.com:8080/jsp/b2c/index.jsp i could int get success then wrote another rule RewriteRule / http://bmw.etl.com/jsp/b2c/index.jsp then i tried out something different but it too had a same error RewriteRule http://bmw.etl.com/ http://bmw.etl.com:8080/jsp/b2c/index.jsp cd /etc/httpd/conf/httpd.conf Jkmount / workers1 ... |
Hi,
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: Code:
RewriteRule (.*) http://bmw.etl.com:8080/jsp/b2c/index.jsp Code:
RewriteCond %{REQUEST_URI} ^/$ |
All times are GMT -5. The time now is 07:36 AM. |