Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Hiding the .JSP extension using mod_write module

Reply
Thread Tools

Hiding the .JSP extension using mod_write module

 
 
Ed
Guest
Posts: n/a
 
      11-02-2006
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?keynam...ynumber=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?keynam...ynumber=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!

 
Reply With Quote
 
 
 
 
shimmyshack
Guest
Posts: n/a
 
      11-03-2006
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/bit...arg2&var3=arg3

http://host/web/variable/path/to/bit...arg1/arg2/arg3

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


Ed wrote:
> 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?keynam...ynumber=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?keynam...ynumber=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!


 
Reply With Quote
 
 
 
 
Ed
Guest
Posts: n/a
 
      11-04-2006

shimmyshack wrote:
> 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/bit...arg2&var3=arg3
>
> http://host/web/variable/path/to/bit...arg1/arg2/arg3
>
> just grab the tar.gz and extract the htaccess file.
>
>
> Ed wrote:
> > 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?keynam...ynumber=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?keynam...ynumber=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!


Hi shimmyshack,

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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using exceptions in defined in an extension module inside anotherextension module Floris Bruynooghe Python 1 12-24-2008 10:33 PM
Script for Hiding/Un-Hiding Text On Click Ste Javascript 41 08-01-2007 02:35 PM
extension question: hiding block proc Dave Lee Ruby 4 04-12-2005 03:41 PM
Getting module object by name in C extension module Ilariu Raducan Python 2 07-14-2004 10:56 AM
Unload extension modules when python22.dll unloads... [using C extension interpreter] Anand Python 3 11-08-2003 05:50 AM



Advertisments