开发者

How to .htaccess RewriteRule?

开发者 https://www.devze.com 2023-02-16 08:34 出处:网络
i\'m trying to make this address: http://www.mysite.co.uk/Listing/London/34 reall开发者_开发技巧y look for: http://www.mysite.co.uk/Listing/listed.php?area=London&list=34

i'm trying to make this address:

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

reall开发者_开发技巧y 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]


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消