onlyican Posted December 28, 2006 Share Posted December 28, 2006 I have a website where all links are running via Mod Rewrites.For ExampleThe Address Bar will showStories/Read/8/ANd the real link isstory/read.php?id=8Nothing too complex.BUTI also have links on the left, which makes the font bigger and smallerI was going to do this by adding ?font=biggerBUTUsing the Mod ReWrites, this does not work, and I also want to keep the link CLEANThe only way I can think of doing this, is for every page, to manually type a link for that pageFor Example<a href='/Stories/Read/8/Bigger_text/Then having the mod rewrite saying something likeReWriteRule ^Stories/Read/([0-9]*)/Bigger_text story/read.php?id=$1&font=biggerReWriteRule ^Stories/Read/([0-9]*)/ story/read.php?id=$1But is there an easier way? Link to comment https://forums.phpfreaks.com/topic/32052-tricky-problem/ Share on other sites More sharing options...
bljepp69 Posted December 28, 2006 Share Posted December 28, 2006 If you don't mind having the '?font=bigger' query string on the end of the URL, you can use the QSA (Query String Append) option in mod_rewrite. So, your link would be: <a href='/Stories/Read/8/?font=bigger'>Bigger Font</a> or <a href='?font=bigger'>Bigger Font</a>You rewrite rule would be: ReWriteRule ^Stories/Read/([0-9]*)/ story/read.php?id=$1 [QSA]and the URL would look like: http://www.yoursite.com/Stories/Read/8/?font=biggerDon't know if that's easier or not. Link to comment https://forums.phpfreaks.com/topic/32052-tricky-problem/#findComment-148833 Share on other sites More sharing options...
onlyican Posted December 28, 2006 Author Share Posted December 28, 2006 You are a star, works a dream Link to comment https://forums.phpfreaks.com/topic/32052-tricky-problem/#findComment-148878 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.