Help Wanted Need to hire someone to develop international domains or need a consultant to help search for IDN domains. Post it here. |

19th April 2010, 01:07 AM
|
 |
Senior Member
|
|
Join Date: Feb 2006
Posts: 2,220
Rep Power: 1306
|
|
Apache mod rewrite help needed
I have a video search engine which pulls content form various external video sources and creates pages dynamically.
Is there a way to prevent certain keywords from being searched, in the .htacces file with mod rewrite and redirect requests to index page?
I tried a 301 redirect old file, but didn't work.
Any help or guidance appreciated.
TIA
|

19th April 2010, 01:43 AM
|
 |
Senior Member
|
|
Join Date: Nov 2009
Posts: 2,962
Rep Power: 7239
|
|
Re: Apache mod rewrite help needed
Your script file that your search form is sending variables to using GET/POST, it could go through a wordlist. If the keyword is in the word list, the user gets redirected to a specific page, if not, the script fetches search results.
Your wordlist could be a separate file so you can update it whenever you want and just upload it on your server.
Is that what you're looking to do ?
|

19th April 2010, 02:23 AM
|
 |
Senior Member
|
|
Join Date: Feb 2006
Posts: 2,220
Rep Power: 1306
|
|
Re: Apache mod rewrite help needed
Squirrel, thanks for the reply.
Yes there is a bad words list and I added the keywords I need excluded there, but it doesn't seem to work.
Since I am php-challenged does the following snipplet of code show the major bad words list on or off? I assume it's on. None of the banned words work on the site though. It pulls video unless there isn't any at the source.
----------------------------------------------
//start new
$i = 0;
while($i<count($major_badwords)) {
$banwords .= "-".$major_badwords[$i]."+";
$i++;
}
/// end new
----------------------------------------------------------------
That's why I wondered if this could work with htacces
Thanks again for your time.
|

19th April 2010, 02:42 AM
|
 |
Senior Member
|
|
Join Date: Feb 2006
Posts: 2,220
Rep Power: 1306
|
|
Re: Apache mod rewrite help needed
OK, I figured it out on the videos part. Now I've got do figure it out to exclude the words from the rss feed [news].
Last edited by yanni; 19th April 2010 at 02:51 AM..
|

19th April 2010, 03:37 AM
|
 |
Veteran
|
|
Join Date: Jan 2006
Posts: 8,733
Rep Power: 5573
|
|
Re: Apache mod rewrite help needed
Yes, you can do it with htacces.
Check this example, which blocks based on keywords like Viagra:
http://www.askapache.com/htaccess/re...tml#menu0-el10
One of my favorite htacces ever.
__________________
Looking for the perfect, still free .com domain name, for your next endeavor? Ask me. $5 only. Here's my most recent, 101th story of success: CarRealtime.com
|

19th April 2010, 09:41 AM
|
 |
Senior Member
|
|
Join Date: Feb 2006
Posts: 2,220
Rep Power: 1306
|
|
Re: Apache mod rewrite help needed
Thanks for the link Jose. Much appreciated.
Lots of learning for me to do, which is always welcome ;]
|

19th April 2010, 03:19 PM
|
 |
Senior Member
|
|
Join Date: Nov 2009
Posts: 2,962
Rep Power: 7239
|
|
Re: Apache mod rewrite help needed
Good luck Yanni.
If you still want to do it using php, there's plenty of "bad words filter" templates online. You can find one easily then use php.net to understand each functions used in the template.
|

20th April 2010, 12:26 AM
|
 |
Member
|
|
Join Date: Jul 2006
Location: upstairs
Posts: 838
Rep Power: 726
|
|
Re: Apache mod rewrite help needed
Quote:
Originally Posted by jose
|
UGGGHHHH!!!!!
Don't ever do this folks. You put this into an .htaccess file and it gets read and parsed on every request matching that directory! If you put this beast into the root dir you're doing this file IO on every request. At least for apache server.
If you really think you want to handle this filtering task at the server config level instead of in the application logic then it belongs in the server config file. That way it's read once, when the process starts up, and that's it.
This is akin to making your restaurant waiter put on very heavy shoes. In the best case he still may serve you your meal with little or no degradation of performance, but in the worst case the service will deteriorate noticeably.
|

20th April 2010, 01:47 AM
|
 |
Veteran
|
|
Join Date: Jan 2006
Posts: 8,733
Rep Power: 5573
|
|
Re: Apache mod rewrite help needed
I have a site with a very heavy htacess and didn't notice any visible degradation of speed, but I might be wrong. Anyway askapache are the experts, not me.
__________________
Looking for the perfect, still free .com domain name, for your next endeavor? Ask me. $5 only. Here's my most recent, 101th story of success: CarRealtime.com
|

20th April 2010, 02:36 AM
|
 |
Member
|
|
Join Date: Jul 2006
Location: upstairs
Posts: 838
Rep Power: 726
|
|
Re: Apache mod rewrite help needed
Quote:
Originally Posted by jose
I have a site with a very heavy htacess and didn't notice any visible degradation of speed, but I might be wrong. Anyway askapache are the experts, not me.
|
Well for a busy server it's a lot of extra overhead. But if it gets the kind of traffic that my Chinese domains get it's a moot point.
I'm considering a process where, on every HTTP request to a Chinese domain of mine, a carrier pigeon delivers a notification to me, I boot up a windows server [install some patches], and fire up IIS to serve that request and then shut it all down afterward. Hopefully I don't go thru all that every year.
Last edited by mdw; 20th April 2010 at 02:37 AM..
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT. The time now is 06:41 PM.
|
|