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

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.


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy