Jump to content

hiding .php extension


rossh

Recommended Posts

Hi i don't have access to modify any apache settings on the server.  I want to hide the .php extension and i'm  trying out renaming the file without an extension and then including ForceType application/x-httpd-php in .htaccess Is this the best method and what are the down sides before i get stuck into my whole site!  Is there alternative if this is not a prefered option?

Thanks

R
Link to comment
Share on other sites

Hi, i was trying this example
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)\.htm$ $1.php [nc]

which i don't think is really what i want but i get the 500 error right away no pages from the subdirectory will load.

Thanks

Ross
Link to comment
Share on other sites

Hi thanks for getting back to me.  I've tried both:-

Options +FollowSymlinks
RewriteEngine on
AddType application/x-httpd-php .htm
AddType application/x-httpd-php .html

and

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.+)\.html$ $1.php

and both give me a 500 error?

Thanks again

R
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.