开发者

php: newbie question about modrewrite

开发者 https://www.devze.com 2023-03-03 19:23 出处:网络
i\'ve started using modrewrite under php - i wrote an .htaccess file and defined some rules. but the main question is - how would i do the \"opposite thing\" of creating the modrewrite-links inside m

i've started using modrewrite under php - i wrote an .htaccess file and defined some rules.

but the main question is - how would i do the "opposite thing" of creating the modrewrite-links inside my web?

eg. i'm using this original url inside my website: /search.php?par1=abc&par2=def&par3=ghi the correspondending modrewrite url would be /go/find/something/here/index.html

so i'd need to replace all html-links in my web using the ugly url with the mod-rewrite url. what's the easiest way to do this? (function for creating开发者_如何学Python urls, using a database ..)

thanks


As this should be a migration job, only done once, go for search/replace. Using a function or database would mean you have to do the migration for each request to your app. Which seems to be unnecessary.


A function. Simply because that way you can replace what the function does with minimal changes to other parts of the website. This is, for example, the way Drupal does it.

0

精彩评论

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