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!