Jump to content

[SOLVED] The Extention ".php" ?


Sangha-08

Recommended Posts

You need to add the html extension to the appropriate AddType section of your apache configuration and restart apache. eg;

 

AddType application/x-httpd-php .php .html

 

Well, I'm a n00b , i have a website running on cpanel (shared hosting), and is there a way to not have a extention at all , could you please tell me where to do that apache code thing in the cpanel. sorry to bother you, I'm 13 and and a n00bie in php. but thanks for your time.

Link to comment
Share on other sites

I've never used cpanel but it is highly unlikely you have access to the apache configuration files.

 

This should also work within a .htaccess file. Simply create (if one doesn't already exist) a file called .htaccess, place it within your document root and write...

 

AddType application/x-httpd-php .php .html

 

If you want to get rid of the extension all together you would need to use some mod_rewrite trickery. Something like....

 

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)$ $1.php [NC]

 

within your .htaccess file will direct addresses such as http://yoursite.com/foo to http://yoursite.com/foo.php and make it look like there is no extension in use.

Link to comment
Share on other sites

i made the .htaccess file using notepad and with the code below and named it .htaccess , http://www.mywebsite.com/watch.php? & http://www.mywebsite.com/watch? now give me and internal server error.

 

Options +FollowSymlinks

RewriteEngine on

RewriteRule ^(.*)$ $1.php [NC]

 

 

I can see what you're trying to do here..and adding .html to the PHP extension list isn't going to help you

 

 

>http://www.mywebsite.com/watch?

>When you go to that address it's looking for a folder called watch not a file.....since there's no extension

>so just create an index.php file inside a "watch" folder identical to your watch.php file and you'll be set.

 

just get rid of the .htaccess file

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.