Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Hide php extension

Discussion in 'General Discussion' started by samuelmf, Nov 2, 2016.

  1. samuelmf

    samuelmf Well-Known Member

    Joined:
    May 22, 2006
    Messages:
    102
    Likes Received:
    4
    Trophy Points:
    168
    Location:
    Perú
    Hi mi friends

    It's possible access a file using variables without use the extension .php of the file

    By example y want to call my file like this:

    Actually it works as this: f.php?u=1321

    I want to do this: f?u=1312

    It's possible? yes? how?

    Thanks in advance
     
  2. Licensecart

    Licensecart Registered

    Joined:
    Feb 15, 2014
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I believe you can use this:
    Code:
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}\.php -f
    RewriteRule ^(.*)$ $1.php
    In your .htaccess
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,794
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice