Question

I have looked over several articles on setting up "Pretty URL's" and I can't seem to get anything to work for me. I am new to the whole .htaccess process and it seems like everything I've seen is geared toward dynamic, .PHP based sites. Here is what I would like to see happen:

Ugly URL: http://www.example.com/test.html
Pretty URL: http://www.example.com/test/

What it am currently trying to use in the .htaccess file is:

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^([a-z]+)$ $1.html

Thus far, I've had no luck. I am not using any form of .php on the page - these are static .html pages. Any help would be extremely appreciated. Thanks!

Was it helpful?

Solution

Nevermind. I figured out what issue was. My compiler was corrupting the .htaccess file, which was triggering the site-wide error message on load. You can see that it's working now here:

http://www.igeniusstore.com/this-test.html

or

http://www.igeniusstore.com/this-test

Here's the basic code that I used:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html

Thanks for all of your help. Cheers!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top