1

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:
http://www.wallpapers-football.net/wallpapers.php?id=705&cat=National%20Team%20Wallpapers
URL into pretty one :
http://www.wallpapers-football.net/705/National%20Team%20Wallpapers.html

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
</files>
ErrorDocument 404 /404-Page.php
0
1

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.

0

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:

^/([^/]*)/([^/]*)\.html$

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