Hello, I'm in need of some help for a course assignment. I've done all of the major work for this web design assignment, except for the following part,
"Build your site so the URLs for each page are in this easy-to-type format, and users don't even know they're accessing PHP files"
I realize that if I have each page in it's own directory, and labeled as index.php, then the file can be accessed without the php extension (example: "mysite.com/lab4/page1" ). However, the problem with that is when you type it in, it simply redirects you to "mysite.com/lab4/page1.php".
I'm fairly certain that the instructor wants us to have it so that the web page displays no .php or .html extension.
I've tried to google search around a bit, and it seems that there is a php code that deals with having an htaccess file, as well as this string of coding:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([^.]+)$ $1.php [NC,L]
Is there any simpler way to do this? The class really hasn't gotten into much php at all, so this seems a bit advanced for the classwork at the moment.
Bookmarks