dc519 Posted January 26, 2008 Share Posted January 26, 2008 I’m having some problems using an .htaccess file together with the .php files on my site. Let me supply the details, my domain is seriesthree.com and I’m only working with two files so far, they are index.php and login.php. Each is quite barebones and only contains a line of text stating the name of the file and then a link to the other page. Also, there is no index.htm or index.html in the directory or on my site whatsoever. Index.php and login.php are located in the root directory along with the .htaccess file. My goal of this, as of yet small project, is to always strip the trailing file extensions, here, .php. from the files in order to create clean urls. I’m using the following instructions in my .htaccess file: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /dispatcher.php [L] I found this code as a result of a previous post at http://keithdevens.com/weblog/archive/2004/May/24/clean-urls.mod_rewrite.php Note that if you simply go to http://seriesthree.com that you won’t see any file extension—in fact you are viewing my index.php page. But then, if you link to login.php, you will see the file extension and if you then link back to index.php, the homepage, you will also see the extension. This is my problem, what am I doing wrong in the .htaccess file that displays the file extension? Here is the code for both index.php and login.php: Index.php: <?php <html> <head> <title>index.php</title> </head> <body>inside index.php <br><br> <a href="login.php">to login.php</a> </body> </html> ?> login.php: <?php <html> <head> <title>login.php</title> </head> <body>inside login.php <br><br> <a href="index.php">back to index.php</a> </body> </html> ?> Quote Link to comment Share on other sites More sharing options...
madmax Posted January 27, 2008 Share Posted January 27, 2008 I just tried it - 14:24 GMT - and it worked fine for me. No PHP exts in either page ??? 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.