hiding extension from url

phalguni_mookhopadhayay used Ask the Experts™
in servlet

<web-app >


if we write url pattern to form action this will call the HelloServlet.
so there is no extension to the url. also for jsp there netui .

how to implement it in php with out using .htaccess.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
You can use the explode function like


$url = "test.HelloServlet";

$urlclass = explode(".",$url);

  echo $urlclass[0] // that will get the value of string prefix the .




PHP is a scripting language. The only way you can achieve this is to use .htaccess and the Apache rewriting engine http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial