views:

178

answers:

2

I am trying to run iJab with Openfire server which requires me to redirect the /http-bind request to localhost:7070/http-bind. I copied the iJAb folder into my document root and wrote the following code inside .htaccess file within the directory

    AddDefaultCharset UTF-8
    Options +FollowSymLinks
    Options +Indexes
    Options +MultiViews
    RewriteEngine On
    RewriteRule /http-bind/ http://localhost:7070/http-bind/ [P]

In httpd.conf , its AllowOverride all

But when I run it, it gives error .. username or password error but firebug console shows 404 error on the ajax post request to

http://localhost/http-bind
. So i have a doubt if its being redirected at all. Is there any way to check if htaccess is actually used or not?

Also, I am not using any virtual host, the server name for both apache server and the openfire server is localhost and address is 127.0.0.1. I let that be since the openfire admin works perfectly on 9090 port and the port for http-bind is 7070

Can this be the reason?

Looking for some ideas

+1  A: 

In case of .htaccess, you need to remove the local path prefix from your pattern:

RewriteRule ^http-bind(/.*)?$ http://localhost:7070/http-bind/ [P]
Gumbo
thanks .. but still no luck. Can you pls explain what you meant by "in case of .htaccess" .. is there any other alternative
naiquevin
@naiquevin: If you use mod_rewrite in a per-directory file like *.htaccess*, it removes the contextual path prefix before testing the patterns and appends them back after applying a rule (see http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritebase). That’s why the leading `/` is wrong in this case.
Gumbo
A: 

The rule you're using has a slash at the end, but the URL you're using doesn't.

Ignacio Vazquez-Abrams
sorry that was a mistake . the request also has the trailing slash
naiquevin