sKunKbad Posted July 10, 2007 Share Posted July 10, 2007 Although this is a mod rewrite, I'm hoping somebody can help me with what I am doing because it involves regex. I've got this mod rewrite rule: ^books/(Title|Author|Keyword)/(.+)/([0-9]+).php5 /newbooks.php5?Action=Search&SearchIndex=Books&SearchString=$1&SearchBy=$2&Page=$3 and its supposed to turn a URLs functionality like this: http://www.mysite/books/Title/jeronimo/1.php5 into this: http://www.mysite/newbooks.php5?Action=Search&SearchIndex=Books&SearchString=star+wars&SearchBy=Title&Page=1 but its not working. Is this my regex, or something else? I have the regexbuddy, so I was pretty certain it wasn't my regex, but i don't know 100%. The URL parameters come from a form, and the action script takes the url parameters and puts them in the new mod rewrite URL like this: if ($_GET['Action'] == 'Passthru'){ header("Location: http://www.mysite.com/books/{$_GET['SearchBy']}/{$_GET['SearchString']}/{$_GET['Page']}.php5"); } The new URL does show up in the browser, so I don't have a clue what is going on. Do you? Quote Link to comment https://forums.phpfreaks.com/topic/59300-regex-right-mod-rewrite-related/ Share on other sites More sharing options...
btherl Posted July 11, 2007 Share Posted July 11, 2007 What happens if you print out that url you are redirecting to instead of redirecting to it? Is it what it should be? Quote Link to comment https://forums.phpfreaks.com/topic/59300-regex-right-mod-rewrite-related/#findComment-295129 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.