Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Hiding the .JSP extension using mod_write module (http://www.velocityreviews.com/forums/t388299-hiding-the-jsp-extension-using-mod_write-module.html)

Ed 11-02-2006 10:58 PM

Hiding the .JSP extension using mod_write module
 
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!


shimmyshack 11-03-2006 04:26 PM

Re: Hiding the .JSP extension using mod_write module
 
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!



Ed 11-04-2006 04:48 PM

Re: Hiding the .JSP extension using mod_write module
 

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!



All times are GMT. The time now is 10:15 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.