hosting - Hide extensions of the pages when hosted -


All,

I had a question on the host. I have pages that are written in php or JSP and hosted on one server. And if a user says in the browser, the main.php or main.asp page will be displayed. My question is one way to hide the extension.

Thanks ...........

Option 1 mod_rewrite / ISAPI rewrite the filter

For mod_rewrite on Apache, it will use the following content in your website's root directory The .htaccess file is as simple as adding ...

The following rules will direct all URIs in this format:

  http://yoursite.com/Content From / page /  

to

  http://yoursite.com/Page.php  

The last bit of IE URI is converted into a PHP file with the same name.

  ^ Content on RewriteRuleRewriteRule =([^/\.]+)/?$ $ 1.php [L, NC, QSA]  

< Strong> Opt Ion 2 directory structure

This is where you have a folder structure to represent your website and each folder has an index.php file. For example,

  http://yoursite.com/Contact-Us/index.php  

In this example,

  http://yoursite.com/Contact-Us/  

gives you an extensionless URI which happens after you because the index.php page is shown by default.

I only mention it because it is a situation where you have a solution on shared windows hosting and can not add ISAPI filter.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -