Can the URL rewite module help me? (mod_rewrite)

I have a php file will generate dynamic pages by different parameter:

I want to replace the above URLs by the followings:

(But actually, I don't have the photos/car/index.php file in the server)

Is it possible to rewrite like this?
I think it is quite diffcult, it would be great appreciated if also tell me how to do it :)

Please advise. Thanks.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Yes, the rewrite engine is meant exactly for this

here is the rule

RewriteEngine on
RewriteRule ^/photos.php?category=(.*)$ /photos/$1


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Thanks, David.

I put the two line in the http.conf file (within the <VirualHost *> tag)

Then, restart the Apache server and no error.

However, when I try the rewrite URL, it says error 404.

What should I check now?
The HTTP 404 error is document not found.

The rule is OK the problem is with it's destination.

In this links

the car and bulding are directories ??

if yes you must add an ending slash into the destination so the rule will be like this

RewriteEngine on
RewriteRule ^/photos.php?category=(.*)$ /photos/$1/

Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

I added the ending slash and restart apache, but still return 404 error. :(
saikitAuthor Commented:
I changed the "AllowOverride None" to "AllowOverride All", then restart apache.

After that, I add the these 2 line into the .htaccess file:

RewriteEngine On
RewriteRule ^photos/(.*) /photos.php?category=$1

Now, it is working.  But, because I using <VirtualHost> for several sites, what is the security implication for chageing to "AllOverride All" that I should consider?

It only defines what can you override for example in .htaccess files.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.