-2

I want to hide the file name with the extinction of .php.I tried to write .htaccess file to restrict my URL.but it is not hiding. any one can help me step by step how to hide the URL. bellow I mentioned actual URL.and expected URL.

Actual URL : varthakindia.com/inners.php?cid1=Hotels

Expected URL: varthakindia.com/Hotels/

nurdglaw
  • 2,107
  • 19
  • 37
rahul
  • 11
  • 1
  • 1
  • 5
    Use mod_rewrite with `htaccess`. – Yogesh Suthar Jun 07 '13 at 10:50
  • http://stackoverflow.com/questions/13896810/hide-url-directory and http://stackoverflow.com/questions/4645411/url-hiding-in-php and http://stackoverflow.com/questions/3007284/hide-url-of-php-page – NetStarter Jun 07 '13 at 10:53

2 Answers2

3

In .htaccess

RewriteEngine On

RewriteRule ^Hotels$ inners.php?cid1=Hotels [L,NS]
php_nub_qq
  • 15,199
  • 21
  • 74
  • 144
2

Use mod_rewrite

RewriteEngine on
RewriteRule ^Hotels/?$ inners.php?cid1=Hotels [L, NS]
baldrs
  • 2,132
  • 25
  • 34