Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How would I rewrite the following using mod_rewrite with wildcards:

http://www.serverurl.com/glossary/WordFind.php?wordInput=(Dynamic Wildcard Word Here)

to:

http://www.serverurl.com/index.php?option=com_glossary&Itemid=326&view=word&word=(Dynamic Wildcard Word Here)
share|improve this question

1 Answer 1

Tested and got this to work.

RewriteEngine On
RewriteCond %{QUERY_STRING} ^wordInput=(.*)$
RewriteRule ^/glossary/WordFind\.php.*$ /index.php?option=com_glossary&Itemid=326&view=word&word=%1 [R]
share|improve this answer
    
My original RewriteCond was against the URI instead of the Query String. I tested this out and it seems to work. –  Sean C. Mar 28 '11 at 19:37
    
I got this to kind of work: –  Joshua Riddle Mar 28 '11 at 22:20
    
i eventualy got this to kind of work RewriteCond %{QUERY_STRING} ^wordInput=(.*) RewriteRule ^glossary/wordfind\.php index.php?option=com_glossary&Itemid=326&view=word&word=%1 However the url it produces stil contains the wordfind.php. keep in mind the fact that all urls are rewritten to lowercase. Thanks for the help so far. @Sean, youve got me closer to the solution. –  Joshua Riddle Mar 28 '11 at 22:22
    
isnt there a special character for removing the original query string? –  Joshua Riddle Mar 28 '11 at 22:23
    
I think you need the / in front of index.php to specify the proper URL. index.php is on the root, is it not? RewriteRule ^glossary/wordfind\.php /index.php?option=com_glossary&Itemid=326&view=word&word=%1 –  Sean C. Mar 28 '11 at 23:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.