0

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!

4sha
  • 326
  • 1
  • 3
  • 12
  • http://stackoverflow.com/q/9309380/139010 – Matt Ball Jun 19 '13 at 20:35
  • Thanks for the comment! I gave the solution the page a shot (and just changed this line: – The iGeniusStore Guy Jun 19 '13 at 20:58
  • Thanks for the comment! I gave the solution the page a shot (and just changed this line: RewriteRule ([^.]+)\.html http://www.quotist.com/$1/%1/%2? [L,R=301] Same 500 error message. Here is the new .htaccess code I am using: Options +FollowSymLinks -MultiViews -Indexes RewriteEngine on RewriteBase / RewriteCond %{ENV:REDIRECT_STATUS} 200 RewriteRule ^ - [L] RewriteCond %{QUERY_STRING} ^(letter)=(\w)$ [NC] RewriteRule ([^.]+)\.html http://www.igeniusstore.com/$1/%1/%2? [L,R=301] RewriteCond %{REQUEST_URI} ^/([\w-]+)/(letter)/\w/? [NC] RewriteRule ^ /%1.html?%2=%3 [L,QSA] – The iGeniusStore Guy Jun 19 '13 at 21:07
  • I even tried this basic code and still cannot get it to work: RewriteEngine On RewriteRule ^this-test/?$ test.html [NC,L] – The iGeniusStore Guy Jun 19 '13 at 21:44

1 Answers1

7

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!