Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 07-01-2002, 04:32 PM   #1
kenny
Confirmed User
 
Industry Role:
Join Date: Mar 2002
Posts: 7,245
.htaccess

Is there a way to change all the links in my domain going to a certain domain to redirect to another.

EXAMPLE:

all links going to http://yahoo.com redirected to http://google.com
__________________
7
kenny is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-01-2002, 04:46 PM   #2
foe
Confirmed User
 
Join Date: May 2002
Location: CT
Posts: 5,246
Not with .htaccess I believe. You can change the mysql code by doing a replace on the file, fastest way
foe is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-01-2002, 05:04 PM   #3
swedguy
Confirmed User
 
Industry Role:
Join Date: Jan 2002
Posts: 7,981
Log on to your server with telnet or ssh.

find /home/bubba/domain.com -name '*.html' -exec perl -pi -e 's/http:\/\/www.yahoo.com/http:\/\/www.google.com/g' {} \;

Change /home/bubba/domain.com to the domain dir you want to mess around in.

If it's a linkingcode you're about to change, you need to escape (put an \ in front of it) certain characters: ? & /

Create a test dir with couple of test files in it to test on first.


btw, I do NOT give ANY guarantees
swedguy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-01-2002, 05:21 PM   #4
kenny
Confirmed User
 
Industry Role:
Join Date: Mar 2002
Posts: 7,245
Quote:
Originally posted by swedguy
Log on to your server with telnet or ssh.

find /home/bubba/domain.com -name '*.html' -exec perl -pi -e 's/http:\/\/www.yahoo.com/http:\/\/www.google.com/g' {} \;

Change /home/bubba/domain.com to the domain dir you want to mess around in.

If it's a linkingcode you're about to change, you need to escape (put an \ in front of it) certain characters: ? & /

Create a test dir with couple of test files in it to test on first.


btw, I do NOT give ANY guarantees

I didn't really understand half of it, but I it worked

whats "-e" "-pi" "{}" for?
__________________
7

Last edited by kenny; 07-01-2002 at 05:30 PM..
kenny is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2002, 12:01 AM   #5
swedguy
Confirmed User
 
Industry Role:
Join Date: Jan 2002
Posts: 7,981
{} = the file "find" found
-e = that you wanna do a one-liner
-i = that you wanna run the one-liner on a file ({} in this case)
-p = can't explain this one in an understandable way Taken from the man page....
causes Perl to assume the following loop around your script, which makes it iterate over filename arguments somewhat like sed.

Great that you got it to work
swedguy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.