| :: |
| Author |
Message |
emma1989

Joined: 17 Sep 2007 Posts: 22
|
Posted: Sun Sep 23, 2007 12:27 am Post subject: search.php keywords mod_rewrite for advanced mod Rewrite |
|
|
I'm sure this could easily be done... more easy than my other "requests"!
I know search keywords work like this:
http://www.example.com/search.php?search_keywords=searchterm
could we mod_rewrite to this....?
http://www.example.com/search/searchterm
searchterm being your keyword in the url examples above
rather like a tag on delicious, but for searches?
Could this be possible - and if so what code changes are needed?
Exact edits?
Thanks so much guys, and congrats again for a great site!
xx |
|
|
| Back to top |
|
 |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
|
| Back to top |
|
 |
emma1989

Joined: 17 Sep 2007 Posts: 22
|
|
| Back to top |
|
 |
emma1989

Joined: 17 Sep 2007 Posts: 22
|
Posted: Wed Sep 26, 2007 9:15 am Post subject: Re: search.php keywords mod_rewrite for advanced mod Rewrite |
|
|
...  |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
|
| Back to top |
|
 |
emma1989

Joined: 17 Sep 2007 Posts: 22
|
Posted: Sat Sep 29, 2007 9:26 pm Post subject: Re: search.php keywords mod_rewrite for advanced mod Rewrite |
|
|
fair enough.
no problems |
|
|
| Back to top |
|
 |
emma1989

Joined: 17 Sep 2007 Posts: 22
|
Posted: Wed Oct 03, 2007 9:00 pm Post subject: Re: search.php keywords mod_rewrite for advanced mod Rewrite |
|
|
This was easy, achieved with only 2 edits one to .htaccess and a quick one in wordgraph.php  |
|
|
| Back to top |
|
 |
SeO Administrateur - Site Admin

Joined: 15 Mar 2006 Posts: 3118
|
Posted: Thu Oct 04, 2007 8:31 am Post subject: Re: search.php keywords mod_rewrite for advanced mod Rewrite |
|
|
Please share  |
_________________
|
|
| Back to top |
|
 |
emma1989

Joined: 17 Sep 2007 Posts: 22
|
Posted: Fri Nov 30, 2007 6:18 pm Post subject: Re: search.php keywords mod_rewrite for advanced mod Rewrite |
|
|
| Code: | foreach ( $words_array as $word => $count )
{
$template->assign_block_vars('wordgraph_loop', array(
'WORD' => ( $board_config['word_graph_word_counts'] ) ? $word . ' (' . $count . ')' : $word,
'WORD_FONT_SIZE' => (int) ( 9 + ( $count * $ratio ) ),
'WORD_SEARCH_URL' => append_sid("search/" . urlencode($word)),
));
}
)); |
Thats in wordgraph.php, at the bottom Simple edit there!
.htaccess is simply
| Code: | | Rewriterule ^search/([a-z0-9_-]*)$ /search.php?return_chars=-1&search_keywords=$1 [QSA,L,NC] |
|
|
|
| Back to top |
|
 |
PerfRen
Joined: 01 Nov 2007 Posts: 36
|
Posted: Tue Dec 04, 2007 2:25 pm Post subject: Re: search.php keywords mod_rewrite for advanced mod Rewrite |
|
|
Hi,
I have the wordgraph too and saw your post so decided to give it a go - very cool idea - the only difference I made was to the .htaccess file as my forum resides in a /forum/ subfolder:
| Code: | | Rewriterule ^forum/search/([a-z0-9_-]*)$ /forum/search.php?return_chars=-1&search_keywords=$1 [QSA,L,NC] |
It all works great and the new tag'esque' Url's open up a search window perfectly. However half the page is then missing and it is looking for all my graphics and template addons in the "search" directory which doesnt exist - and the URL's for the search posts now have "/search/" in them so the links dont work!
See: http://www.performancerenaults.com/forum/wordgraph.php
Is there any way of fixing this and getting it to work as it should?
If there isnt I will revert my copy of wordgraph and remove the .htaccess line.
Thanks for any help in advance! |
|
|
| Back to top |
|
 |
PerfRen
Joined: 01 Nov 2007 Posts: 36
|
Posted: Thu Dec 06, 2007 9:05 am Post subject: Re: search.php keywords mod_rewrite for advanced mod Rewrite |
|
|
...  |
|
|
| Back to top |
|
 |
SeO Administrateur - Site Admin

Joined: 15 Mar 2006 Posts: 3118
|
Posted: Sun Dec 09, 2007 1:25 pm Post subject: Re: search.php keywords mod_rewrite for advanced mod Rewrite |
|
|
Thanks for sharing emma1989, looks like we now have a patch for the wordgraph mod thanks to you  |
_________________
|
|
| Back to top |
|
 |
PerfRen
Joined: 01 Nov 2007 Posts: 36
|
Posted: Mon Dec 10, 2007 9:09 am Post subject: Re: search.php keywords mod_rewrite for advanced mod Rewrite |
|
|
However it doesnt fully work
There is one piece missing which is my post above! |
|
|
| Back to top |
|
 |
SeO Administrateur - Site Admin

Joined: 15 Mar 2006 Posts: 3118
|
Posted: Mon Dec 10, 2007 1:09 pm Post subject: Re: search.php keywords mod_rewrite for advanced mod Rewrite |
|
|
Ho, I see.
Just add :
| Code: | | <base href="http://www.yourdomain.com/phpbbpath/"> |
after :
In your overall_header.tpl  |
_________________
|
|
| Back to top |
|
 |
PerfRen
Joined: 01 Nov 2007 Posts: 36
|
Posted: Mon Dec 10, 2007 1:26 pm Post subject: Re: search.php keywords mod_rewrite for advanced mod Rewrite |
|
|
Thanks for the reply...
Which file do I need to do that to?
Many thanks  |
|
|
| Back to top |
|
 |
|
|