Please help - a basic rewrite for friendly URLs

New to mod_rewrite? This is a good place to start.

Please help - a basic rewrite for friendly URLs

Postby Guest » Mon Jun 20, 2005 5:02 pm

Hi,

Trying to use mod rewrite to make my php urls more search engine friendly.

I first had:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-F
RewriteRule ^([-_.a-zA-Z0-9]+)$ profile.php?profile=$1

This works, so that for example, www.domain.com/profile.php?profile=jane
becomes www.domain.com/jane

My question is:

How do I then include the next level - e.g. http://www.domain.com/profile.php?profi ... ion=images to become www.domain.com/jane/images

Someone kindly suggested I try this line:
RewriteRule ^([^/]+)\/([^/]+)$ profile.php?profile=$1&section=$2 [L]

But that doesn't work for me (www.domain.com/jane says page doesn't exist). Am I doing something wrong?

Any help appreciated!!!

Thanks
Guest
 

Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 85 guests

cron