IBM HTTP Server Routing/Rewriting problem

Posted on 2009-04-17
Last Modified: 2013-12-11

I have installed an application on Standalone WebSphere Application Server and I configured the application with the IBM HTTP Server by generating plugin.

As we had an IIS server installed on the same machine so we are using http port 8080 and https port 443 for IBM HTTP Server.

Now I am able to access the application using the URL http://machinename:8080/<application-name>

However, I have been asked to implement a short URL which will route to this http://machinename:8080/<application-name>

So, I have updated the httd.conf file by adding the code below and created a DNS entry  like abc

LoadModule rewrite_module modules/
NameVirtualHost <host-name>:8080

#First Redirection
<VirtualHost <host-name>:8080>
ServerName abc
DocumentRoot "D:/IBM/HTTPServer/htdocs/en_US"
RewriteEngine on
RewriteRule ^/(.*) http://<host-name>:8080/<application-name> [R,L]

Then I restarted both IBM HTTP Server and the WAS.

Now the problem is when I try to hit this short URL http://abc:8080 I am getting "Page Cannot be  displayed error."

Moreover, its not even working with this URL http://<hostname>:8080/<application-name> too

So I changed the port number to 9080 in the redirection code inside httpd.conf file i.e

RewriteRule ^/(.*) http://<host-name>:9080/<application-name> [R,L]

Now it works like a charm...I am able to rewrite the short URL http://abc:8080 to lengthy URL

My question is why its not working with the port 8080 in the redirection code.

If I use port 9080 instead of port 8080 inside the redirection code then there is no point of using the plugin file but I want the http request to be routed through Plugin.

So, please advice if there is anything I can do to fix this issue.

Thanks in Advance !!!

Question by:WASAdmin25
    LVL 4

    Expert Comment


    I guess you have not updated the new DNS entry abc:8080 in the WAS Virtual host alias.  Once update the Virtual host entry please restart webserver and Application server.
    The Plugin file must be looking for the new DNS entry with the port number.
    If you are using the hostname:9080 it is directly hitting the WebContainer,so it is bypassing the Plugin file.
    Still you find error could you send us the Plugin log, error/access log.

    Author Comment


    Thanks for your response...!!

    I have updated the new DNS entry abc:8080 in the WAS virtual host alias and restarted the WAS and webserver(IBM Http Server). Moreover, I have generated and propagated the plugin-cfg.xml from the WAS console too.

    After making all these updates I couldn't find any changes while accessing the application.

    i.e whenever I try to access the application using http://abc:8080 it goes to the trying mode but it never completes the request.

    I believe there is something missing in the code of rewriting in httpd.conf becoz I removed the rewriting code and tried with http://hostname:8080/<application-name> and it works with http server hostname.

    However its not working while rewriting the short URL.

    Anyways I have attached the log files too.

    Please Advice !!!!


    LVL 4

    Accepted Solution


    The Virtual host entry in the httpd.conf fille should be abc:8080 not the hostname, then you should be providing the redirect match You wont be able to access abc:8080 from the browser since there is no website named abc:8080 running. So ur trying to hit the non-working url.
    Once u hit the hostname:8080 u can access since there 8080 is listening on hostname.

    1. U can configure redirect in different ways. u can configure with index.html file tagged with redirect url
    ex: DirectoryIndex Index.html(Inside Virtual host)
    Index.html file can be tagged with
    <META HTTP-EQUIV="Refresh" Content="0; URL=https://abc:8080/context-root">
    2. u can use Redirect 301 / http://abc:8080/<context root>

    3. U can user rewrite engine.

    LVL 51

    Expert Comment

    I iguess you mean:

    ServerName your-host-name
    ServerAlias abc

    then you also don't need a rewrite rule.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
    Cloud file services can fill many different roles for your business. Often, the use of cloud file services begins with employees using consumer products, like Dropbox, to share files with customers and each other. While sync-and-share can be an effe…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now