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.

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.

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 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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.