• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hide .html extension

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I use CQ5 as application server and apache as front end. My CQ5 url is ( http://testuser.com:6703/testclient/en.html). I have configured apache Mod_PROXY to access CQ5 url without 6703 port. When i use apache url http:// testuser.com/testclient , it succssfully redirect to http://testuser.com:6703/testclient/en.html (please see below proxy setting) Now my concern is i want to hide/remove .html from browser. Please let me know if there is any way using Redirect rule or Proxy rule we can hide url extension.

Apache configuration

ProxyPass / http://testuser.com:6703/ keepalive=on
ProxyPassReverse / http://testuser.com:6703/

Thank you,
Prashant
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You would use mod_rewrite to alter or remove information from an incoming URL.

But if you do that, you are removing critical information that the webserver uses to determine how to process the incoming request. That ".html" isn't just some sort of local filesystem extension, it's part of the MIME-typing process. It tells the server to look for and serve an HTML document, so if you remove the .html, the server won't work properly.

Going in the other direction, you can append an ".html" to incoming URL requests before forwarding them to Tomcat, but if you don't code the rules correctly, it will append even to non-html requests such as servlet and JSP URLs.

It's not something I'd do just because ".html" offends me. Besides, people are used to it and generally only pay attention when they confuse an ".htm" with an ".html" or vice-versa. More generally, however, they're only manually entering a URL to get to the welcome page, where the welcome mechanism not only already knows the MIME type, it knows the page name.
 
Prashant Karmankar
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Tim. Please let me know how to use mod_rewrite to alter or remove information from an incoming URL.

Thanks,
Prashant.
 
Tim Holloway
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://httpd.apache.org/docs/current/mod/mod_rewrite.html
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic