Tom
Tom

Reputation: 9643

How to .htaccess RewriteRule?

i'm trying to make this address:

http://www.mysite.co.uk/Listing/London/34

really look for: http://www.mysite.co.uk/Listing/listed.php?area=London&list=34 behind the scenes.

I tried this ReWrite in the htacess file in "Listing" folder but it dosen't work:

RewriteRule ^([a-z0-9]+)/([a-z0-9]+)$ /listed.php?area=$1&list=$2 [NC,L]

Upvotes: 0

Views: 95

Answers (2)

Gumbo
Gumbo

Reputation: 655169

Try a relative substitution path instead:

RewriteRule ^([a-z0-9]+)/([a-z0-9]+)$ listed.php?area=$1&list=$2 [NC,L]

It can also be possible that you’re not allowed to use .htaccess files besides in the document root directory.

Upvotes: 2

Michael Berkowski
Michael Berkowski

Reputation: 270609

I think you only need to remove the ^ from the beginning and change the destination from /listed.php to /Listing/listed.php

Upvotes: 1

Related Questions