NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page .htaccess

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
5 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 10-06-2006, 04:06 PM THREAD STARTER               #1 (permalink)
Tandiono.com
 
tandiono's Avatar
Join Date: Jun 2005
Location: FuckingBusiness.net
Posts: 373
tandiono is on a distinguished road
 



.htaccess


Is there anyway that i could change a certain words on my site,

example :
"dick head" to "praise the mighty lord" by .htaccess ?

so if any of "dick head" words were post it will be automatically change to "praise the mighty lord"


To anyone please kindly assist me. Thanks in advance
__________________
Tandiono.com | Mikess.com | WebsiteForum.net | AudioForum.net | ToysForum.net | GadgetForum.net | ClickBankForum.net | ForumBoards.net | VerySoon.net | ClickBanks.net
tandiono is offline  
Old 10-06-2006, 04:12 PM   #2 (permalink)
Dan
Buy my domains.
 
Dan's Avatar
Join Date: Feb 2006
Posts: 2,792
Dan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant future
 


Autism Autism Autism Autism Autism Autism Autism
Code:
RewriteEngine on
RewriteRule (.*)?dick(.*)?head(.*)? $1praise_the_mighty_lord$3 [R]
I'm not sure if you can use spaces in it which is why I allowed for anything inbetween dick head. If that doesn't work, tell me and I'll try harder.
Dan is offline  
Old 10-06-2006, 04:17 PM THREAD STARTER               #3 (permalink)
Tandiono.com
 
tandiono's Avatar
Join Date: Jun 2005
Location: FuckingBusiness.net
Posts: 373
tandiono is on a distinguished road
 



Originally Posted by Dan
Code:
RewriteEngine on
RewriteRule (.*)?dick(.*)?head(.*)? $1praise_the_mighty_lord$3 [R]
I'm not sure if you can use spaces in it which is why I allowed for anything inbetween dick head. If that doesn't work, tell me and I'll try harder.

????: NamePros.com http://www.namepros.com/programming/244812-htaccess.html
Thanks for the reply

well, just try it but not working. Is there any other way?
__________________
Tandiono.com | Mikess.com | WebsiteForum.net | AudioForum.net | ToysForum.net | GadgetForum.net | ClickBankForum.net | ForumBoards.net | VerySoon.net | ClickBanks.net
tandiono is offline  
Old 10-06-2006, 04:17 PM   #4 (permalink)
Senior Member
 
AdoptableDomains's Avatar
Join Date: Aug 2003
Location: SW Ohio
Posts: 4,015
AdoptableDomains has a brilliant futureAdoptableDomains has a brilliant futureAdoptableDomains has a brilliant futureAdoptableDomains has a brilliant futureAdoptableDomains has a brilliant futureAdoptableDomains has a brilliant futureAdoptableDomains has a brilliant futureAdoptableDomains has a brilliant futureAdoptableDomains has a brilliant futureAdoptableDomains has a brilliant futureAdoptableDomains has a brilliant future
 

Member of the Month
May 2006
Animal Rescue Special Olympics Third World Education VA Tech Memorial
I don't think .htaccess can do it, however, I know some forum software has the ability to do this with postings. I had a forum member keep spam posting a website in every post and I set the forum up to replace his website name with "I'm a spammer". After I while, I think he got the message.

You might do a search for a "search and replace" script and set it up as a cron job.

http://www.hotscripts.com/Tools_and_...ace/index.html
__________________
AdoptableDomains.com ~~~~~Finding Good Homes for Good Names~~~~~
FuelPrices.mobi - Fish.us - ManhattanNewYork.net - Salesmen.info - SoundSystems.org
Dickering.com - JobPlacement.biz - LotteryTickets.ws - Deleted.cc - Names.im - MP3.hn
AdoptableDomains is offline  
Old 10-06-2006, 04:22 PM THREAD STARTER               #5 (permalink)
Tandiono.com
 
tandiono's Avatar
Join Date: Jun 2005
Location: FuckingBusiness.net
Posts: 373
tandiono is on a distinguished road
 



Originally Posted by AdoptableDomains
I don't think .htaccess can do it, however, I know some forum software has the ability to do this with postings. I had a forum member keep spam posting a website in every post and I set the forum up to replace his website name with "I'm a spammer". After I while, I think he got the message.
????: NamePros.com http://www.namepros.com/showthread.php?t=244812

You might do a search for a "search and replace" script and set it up as a cron job.

http://www.hotscripts.com/Tools_and_...ace/index.html

well, can't find any source which could perform this action on hotscripts.com .. it's actually for my blog site, which i need to force change a certain words looking if there are anyway which could force change words by .htaccess
__________________
Tandiono.com | Mikess.com | WebsiteForum.net | AudioForum.net | ToysForum.net | GadgetForum.net | ClickBankForum.net | ForumBoards.net | VerySoon.net | ClickBanks.net
tandiono is offline  
Old 10-06-2006, 04:23 PM   #6 (permalink)
Dan
Buy my domains.
 
Dan's Avatar
Join Date: Feb 2006
Posts: 2,792
Dan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant future
 


Autism Autism Autism Autism Autism Autism Autism
Code:
RewriteEngine on
RewriteRule (.*)?dick(.*)?head(.*)? $1praise_the_mighty_lord$3 [NC,R]
I tested that it replaces dick head with praise_the_mighty_lord and it worked. [I added the NC,]

If it goes to some crazy URL when it does it, show me the URL it goes to.
Dan is offline  
Old 10-06-2006, 04:28 PM THREAD STARTER               #7 (permalink)
Tandiono.com
 
tandiono's Avatar
Join Date: Jun 2005
Location: FuckingBusiness.net
Posts: 373
tandiono is on a distinguished road
 



Originally Posted by Dan
Code:
RewriteEngine on
RewriteRule (.*)?dick(.*)?head(.*)? $1praise_the_mighty_lord$3 [NC,R]
I tested that it replaces dick head with praise_the_mighty_lord and it worked. [I added the NC,]
????: NamePros.com http://www.namepros.com/showthread.php?t=244812

If it goes to some crazy URL when it does it, show me the URL it goes to.

just try it, but still not working either. Im trying it on the plain .htm file
__________________
Tandiono.com | Mikess.com | WebsiteForum.net | AudioForum.net | ToysForum.net | GadgetForum.net | ClickBankForum.net | ForumBoards.net | VerySoon.net | ClickBanks.net
tandiono is offline  
Old 10-06-2006, 04:32 PM   #8 (permalink)
Dan
Buy my domains.
 
Dan's Avatar
Join Date: Feb 2006
Posts: 2,792
Dan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant future
 


Autism Autism Autism Autism Autism Autism Autism
Can you show me where you are using it and what it goes to? I just tested it and it worked..

What are you trying on an HTML file??
Dan is offline  
Old 10-06-2006, 04:35 PM THREAD STARTER               #9 (permalink)
Tandiono.com
 
tandiono's Avatar
Join Date: Jun 2005
Location: FuckingBusiness.net
Posts: 373
tandiono is on a distinguished road
 



Originally Posted by Dan
Can you show me where you are using it and what it goes to? I just tested it and it worked..

What are you trying on an HTML file??

Try it on : http://habrturk.com/1.htm
__________________
Tandiono.com | Mikess.com | WebsiteForum.net | AudioForum.net | ToysForum.net | GadgetForum.net | ClickBankForum.net | ForumBoards.net | VerySoon.net | ClickBanks.net
tandiono is offline  
Old 10-06-2006, 05:11 PM   #10 (permalink)
Dan
Buy my domains.
 
Dan's Avatar
Join Date: Feb 2006
Posts: 2,792
Dan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant future
 


Autism Autism Autism Autism Autism Autism Autism
I have no clue what you are doing..
http://habrturk.com/dick_head goes to http://www.travels.sg/
Also, you're 1.htm can't do anything with the URL so..
Dan is offline  
Old 10-07-2006, 01:36 AM   #11 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,074
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 


Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
Dan he is trying to change the text on a page not the address of the page.

tandiono is the blog written in php? If so you could do something like the following on the output:-

PHP Code:
<?php
????: NamePros.com http://www.namepros.com/showthread.php?t=244812
$users_string 
'This is text that will get adapted before output';
$find[0] = '/text/';
$find[1] = '/adapted/';
$replace 'changed';
echo 
preg_replace($find$replace$users_string);
?>
Obviously you would change the contents of the $find array to words/phrases that you wish to replace ($replace is what replaces these) and obviously the $user_string variable would be changed to the variable that holds the post.
Peter is offline  
Old 10-07-2006, 08:13 AM   #12 (permalink)
Dan
Buy my domains.
 
Dan's Avatar
Join Date: Feb 2006
Posts: 2,792
Dan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant future
 


Autism Autism Autism Autism Autism Autism Autism
If he said anything about forms, $_GET, or $_POST, I could help. He asked to do it via .htaccess and that's what I did.
Dan is offline  
Old 10-07-2006, 07:30 PM   #13 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,074
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 


Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
Originally Posted by tandiono
so if any of "dick head" words were post it will be automatically change to "praise the mighty lord"
come on dan is it not obvious from the above qoute he as on about posts by other people on the site.
Peter is offline  
Old 10-07-2006, 07:50 PM   #14 (permalink)
Dan
Buy my domains.
 
Dan's Avatar
Join Date: Feb 2006
Posts: 2,792
Dan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant future
 


Autism Autism Autism Autism Autism Autism Autism
I gave him what he asked for. All I was trying to do was help him.

Originally Posted by tandiono
"dick head" to "praise the mighty lord" by .htaccess ?
Dan is offline  
Old 10-07-2006, 07:54 PM   #15 (permalink)
Senior Member
 
Barrucadu's Avatar
Join Date: Aug 2005
Location: East Yorkshire, England
Posts: 2,689
Barrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to behold
 




Stop arguing, lol.

Its easy to make a simple mistake about different web technologies.
Barrucadu is offline  
Old 10-07-2006, 07:58 PM THREAD STARTER               #16 (permalink)
Tandiono.com
 
tandiono's Avatar
Join Date: Jun 2005
Location: FuckingBusiness.net
Posts: 373
tandiono is on a distinguished road
 



that's allright guys


Thanks for the help.. I'll try to play around with it..
__________________
Tandiono.com | Mikess.com | WebsiteForum.net | AudioForum.net | ToysForum.net | GadgetForum.net | ClickBankForum.net | ForumBoards.net | VerySoon.net | ClickBanks.net
tandiono is offline  
Old 10-08-2006, 07:58 PM   #17 (permalink)
Resistance is Futile
 
Kadenz's Avatar
Join Date: Apr 2006
Location: Montreal, Canada
Posts: 1,094
Kadenz is a name known to allKadenz is a name known to allKadenz is a name known to allKadenz is a name known to allKadenz is a name known to allKadenz is a name known to all
 



Wildlife Lou Gehrig's Disease (ALS)
.htaccess can't do this, only a server side program such as PHP can do this.
The example filth@flexiwebhost gave would work as well as the str_replace function.
__________________
Freelance Web Developer
PHP, MySQL, XHTML, CSS, Javascript, jQuery, Wordpress
Portfolio: www.bundy.ca
Kadenz is offline  
Old 10-09-2006, 06:32 PM   #18 (permalink)
Senior Member
 
AdoptableDomains's Avatar
Join Date: Aug 2003
Location: SW Ohio
Posts: 4,015
AdoptableDomains has a brilliant futureAdoptableDomains has a brilliant futureAdoptableDomains has a brilliant futureAdoptableDomains has a brilliant futureAdoptableDomains has a brilliant futureAdoptableDomains has a brilliant futureAdoptableDomains has a brilliant futureAdoptableDomains has a brilliant futureAdoptableDomains has a brilliant futureAdoptableDomains has a brilliant futureAdoptableDomains has a brilliant future
 

Member of the Month
May 2006
Animal Rescue Special Olympics Third World Education VA Tech Memorial
Originally Posted by Borghunter
.htaccess can't do this, only a server side program such as PHP can do this.
The example filth@flexiwebhost gave would work as well as the str_replace function.
I may be wrong, but I think .htaccess can only effect what is acually displayed in the browser, or to what page the browser visits. I don't believe it actually changes anything on an html web page level.
????: NamePros.com http://www.namepros.com/showthread.php?t=244812

I would suggest a better solution would be to filter before the post is actually written, or find/replace the posted text shortly after written. To help with that, we would probably need to know the application being used and the format of the posting (HTML form, PHP, etc.)
__________________
AdoptableDomains.com ~~~~~Finding Good Homes for Good Names~~~~~
FuelPrices.mobi - Fish.us - ManhattanNewYork.net - Salesmen.info - SoundSystems.org
Dickering.com - JobPlacement.biz - LotteryTickets.ws - Deleted.cc - Names.im - MP3.hn
AdoptableDomains is offline  
Old 10-09-2006, 06:40 PM   #19 (permalink)
Dan
Buy my domains.
 
Dan's Avatar
Join Date: Feb 2006
Posts: 2,792
Dan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant future
 


Autism Autism Autism Autism Autism Autism Autism
Originally Posted by AdoptableDomains
I may be wrong, but I think .htaccess can only effect what is acually displayed in the browser, or to what page the browser visits. I don't believe it actually changes anything on an html web page level.
.htaccess can do loads more things than what is "shown" in these types of threads.
????: NamePros.com http://www.namepros.com/showthread.php?t=244812

If tandiono is looking for help with an HTML <form .. that uses method="post", .htaccess won't be able to help. It could help, however, if it used get.
Dan is offline  
Old 10-09-2006, 09:50 PM   #20 (permalink)
NamePros Regular
Join Date: Feb 2006
Posts: 276
xeno439 is a jewel in the roughxeno439 is a jewel in the roughxeno439 is a jewel in the rough
 



To learn a good bit about .htaccess, check out this.
http://www.javascriptkit.com/howto/htaccess.shtml
xeno439 is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


 
All times are GMT -7. The time now is 02:16 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger