views:

31

answers:

1

Hello all,

I want to change my current url to a modified one. suppose my current url is www.abc.com/xyz/location.htm i want it to change to www.abc.com/location.htm

please suggest a suitable way.... Thanks in advance

A: 

If you are running Apache servers, I'd suggest using mod_rewrite.

In that case you should have something like this in your .htaccess -file at the top level of your server root:

RewriteEngine on
RewriteRule  ^abc.com/xyz/(.*)$  <your_root_directory>/$1
plouh
Yes i m using Apache server...
neeraj
here <your_root_directory> refers to where my application is present in tomcat??
neeraj
It's the URL to the root of your application, so if you want to remove xyz, it should be enough just to remove the your directory part altogether. Also I am not sure if you need the host part (^abc.com) either if you use .htaccess at the top of your web application.
plouh
Can you please elaborate...... m not understanding much as m just started using Apache server..
neeraj
@neeraj: Your comment above appears to suggest that you may be using "tomcat". Just to clarify, are you using "Apache Webserver" or "Apache Tomcat"? They are 2 very different things.
Asaph
My war file is deployed in apache tomcat....n i m access it using Apache Webserver.Hence instead of giving localhost:8080 to open the application m using only localhost.
neeraj