Results 1 to 3 of 3
Like Tree1Likes
  • 1 Post By dutchiseasy

Thread: htaccess | remove .php from url

  1. #1
    dutchiseasy is offline Junior Member
    Join Date
    Feb 2015
    Posts
    2

    Default htaccess | remove .php from url

    This .htaccess code below should be able to remove .php from the url, but in altervista it doesn't work. Can't seem to solve the problem. Does anyone have an idea?

    Code:
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^([^\.]+)$ $1.php [NC,L]
    Last edited by karl94; 03-18-2015 at 08:52 PM. Reason: Code formatting

  2. #2
    karl94 is offline AlterVista Staff
    Join Date
    Jan 2015
    Posts
    573

    Default

    This should work:
    Code:
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^([^\.]+)$ /$1.php [NC,L]
    If you are on the root directory.

  3. #3
    dutchiseasy is offline Junior Member
    Join Date
    Feb 2015
    Posts
    2

    Default

    Thank you, the extra / worked!
    slotcars likes this.

Tags for this Thread

Posting Permissions

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

SEO by vBSEO