954,135 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

.htaccess mod_rewrite problem

What's wrong with the following line in my .htaccess file? All of my other rewrites work, just not this one.

I want
http://www.techtalkforums.com/forums/viewtopic.php?t=10&view=previous
http://www.techtalkforums.com/forums/viewtopic.php?t=10&view=next
http://www.techtalkforums.com/forums/viewtopic.php?t=10&view=newest

to look like
http://www.techtalkforums.com/forums/t10previous.html
http://www.techtalkforums.com/forums/t10next.html
http://www.techtalkforums.com/forums/t10newest.html

I'm using the following code but it doesn't seem to work? It just goes to topic 10 (for example) while ignoring the view parameter. Any ideas?

RewriteRule ^t([0-9]+)(.*).(.*)$ /forums/viewtopic.php?t=$1&view=$2 [L]
cscgal
The Queen of DaniWeb
Administrator
19,421 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 229
 

I figured out the problem. There was nothing wrong with this line. It's just that I also had another RewriteRule in the same format that took the same number of paramaters, that did something different entirely. I guess I just didn't realize it! ;)

cscgal
The Queen of DaniWeb
Administrator
19,421 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 229
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: