Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I spent hours in finding how to make my url pretty but no luck. I am hosted in DreamHost and using php under fcgi. I'm triying to make my:
URL into pretty one :

Why is this not working:

RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)\.html$ /wallpapers.php?id=$1&cat=$2 [L]

my htaccess:

#--- DH-PHP handlers ---
Options +FollowSymLinks +ExecCGI
AddHandler fastcgi-script fcg fcgi fpl
AddHandler php5-fastcgi .php
Action php5-fastcgi /cgi-bin/dispatch.fcgi

Options All -Indexes

<files .htaccess>
order allow,deny
deny from all
ErrorDocument 404 /404-Page.php
share|improve this question

migrated from stackoverflow.com Jul 24 '13 at 4:15

This question came from our site for professional and enthusiast programmers.

Try something like (untested): RewriteRule ^/([0-9]+)/(.*)\.html$ /wallpapers.php?id=$1&cat=$2 [L]

The first match should match any #'d category (and it would have to be a number), while the second grouping will match the remaining string.

share|improve this answer

Depending on your version (are you using Apache?) you may need to include the leading slash / at the beginning of your regular expression (after the start anchor) like this:


This worked for me. Otherwise, make sure you have the host name set correctly, look at your rewrite.log or other logs, and post if there are any errors.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.