Wex
Wex

Reputation: 15695

Trouble with .htaccess file

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^(css|js|images)
RewriteRule ([A-Za-z0-9-]+).html index.php?page=$1 [L]

This is as far as I could get, it doesn't seem to meet all the qualifications that I need. Basically, if a user on my site goes to mydomain.com/([A-Za-z0-9-]+).html, I want my server to see mydomain.com/index.php?page=$1. If they go to any other file, or a folder other than css, images, js, or js/util, I want the server to see mydomain.com/index.php? or mydomain.com/index.php?page=. Thanks for your help!

Upvotes: 0

Views: 34

Answers (1)

hjpotter92
hjpotter92

Reputation: 80639

RewriteRule ([A-z0-9\-]+).html$ index.php?page=$1 [L]
  1. Use \- inside the set matching.
  2. Instead of !-d, I think you need to use !-f.

Take a look at THIS link.

Upvotes: 1

Related Questions