torel Posted August 2, 2014 Share Posted August 2, 2014 SOLVED. I'm hosted at hostgator, but I hope I can get some help here.So some of the design on my page is being directed there by php.&--#60;?php include_once("templateDesign.php"); ?&--#62;I wanted to remove the file extensions, so you could just type mysite.com/example and the .php extension wouldn't come up. I did this by using this code in my htaccess file:# Apache Rewrite Rules &--#60;IfModule mod_rewrite.c&--#62; Options +FollowSymLinks RewriteEngine On RewriteBase / # Remove .php-extension from url RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^([^\.]+)/$ $1.php # End of Apache Rewrite Rules &--#60;/IfModule&--#62;Now, the problem is it isn't loading the content from the .php correctly. Just some come up, indicating that it reaches the .php file with content, but doesn't load it correctly. Quote Link to comment Share on other sites More sharing options...
Byron Posted August 2, 2014 Share Posted August 2, 2014 Go ahead and create your file with a .php extension and then add this to the .htaccess: Options +MultiViews Then you can remove the .php from the url like this: http://bybyron.net/test/hello_world or http://bybyron.net/test/hello_world.php Also work for image files. This is how it works here at heliohost. Not sure about HostGator. Quote Link to comment Share on other sites More sharing options...
torel Posted August 2, 2014 Author Share Posted August 2, 2014 Go ahead and create your file with a .php extension and then add this to the .htaccess: Options +MultiViews Then you can remove the .php from the url like this: http://bybyron.net/test/hello_world or http://bybyron.net/test/hello_world.php Also work for image files. This is how it works here at heliohost. Not sure about HostGator. Thanks a ton, that worked Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.