torel Posted August 2, 2014 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.
Byron Posted August 2, 2014 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.
torel Posted August 2, 2014 Author 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now