www.webdeveloper.com
Results 1 to 4 of 4

Thread: How to hide the extension in url in PHP

Hybrid View

  1. #1
    Join Date
    Jul 2012
    Posts
    32

    How to hide the extension in url in PHP

    How to hide the extension in url in PHP

  2. #2
    Join Date
    Mar 2009
    Posts
    452
    put the following lines in your .htaccess file

    Code:
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}.php -f
    RewriteRule ^(.+)$ /$1.php [L,QSA]

  3. #3
    Join Date
    Jul 2012
    Posts
    32
    I am using wampserver 2.2.Where I have to post the thing.I didn't get it.

  4. #4
    Join Date
    Mar 2009
    Posts
    452
    you need to study some basics about .htaccess, it is a file used to configure Apache Server on individual directory basis.

    to make it simple: create a new file with notepad or any favorite editor, paste the above text in, save it as ".htaccess" in the folder you want to hide PHP extensions in (if it does not exist).


    also make sure you turn on rewrite_module; click on WAMP icon in notification area. Apache>Apache Modules>rewrite_module

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles