0

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)

1 Answers1

0

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]
Sean C.
  • 954
  • 5
  • 7
  • 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
  • No it totally breaks with that "/"..I should add that i have aceSEF installed and its in joomla..However this is all in the .htacces before anything even gets to joomla. – Joshua Riddle Apr 02 '11 at 21:09