Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2006

Tip: Looking for answers? Try searching our database.

Hiding the .JSP extension using mod_write module

Thread view: 
Ed - 02 Nov 2006 23:58 GMT
Hi All,

I would like to hide the extension of my jsp page.

My correct URL is this one, with a .JSP extension:

http://localhost/Web/view.jsp?keyname=name&keynumber=number

But I would like the End-USer to use the following URL with .ASP
extension, on the internet browser, and once she/he does, it's going to
be redicted to the .JSP extension, on the fly!

http://localhost/Web/view.asp?keyname=name&keynumber=number

Could you anyone tell me what I am doing wrong below, with the
mod_rewrite module in my Apache's http.conf file?

<VirtualHost *:80>

RewriteEngine on
RewriteRule ^(.*)\.asp$ $1.jsp [L]

</VirtualHost>

Thanks!
shimmyshack - 03 Nov 2006 17:26 GMT
not much really just change [L] to be [L,QSA] (for query string append)

if you go one stage further you get the benefit of hiding the
technology and using apache to perform regular expressions on your
query string args, as well as being search engine friendly.

Wordpress has a great .htaccess file (complex but real world) which
shows very nicely how to completely change a complex site from urls of
the form

http://host/web/variable/path/to/bits/of/app/dynpage.tech?var1=arg1&var2=arg2&var3=arg3

http://host/web/variable/path/to/bits/of/app/dynpage/arg1/arg2/arg3

just grab the tar.gz and extract the htaccess file.

> Hi All,
>
[quoted text clipped - 21 lines]
>
> Thanks!
Ed - 04 Nov 2006 17:48 GMT
> not much really just change [L] to be [L,QSA] (for query string append)
>
[quoted text clipped - 37 lines]
> >
> > Thanks!

Hi shimmyshack,

Thanks for the info! I will try and see if your suggestion resolves my
problem!


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.