|
|
|
||||
|
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. |
![]() |
|
|||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
|
Thread Tools |
|
|
#1 |
|
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 |
|
|
|
|
|
#2 |
|
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
|
|
|
|
|
|
#3 |
|
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 |
|
|
|
|
|
#4 | |
|
Confirmed User
Industry Role:
Join Date: Mar 2002
Posts: 7,245
|
Quote:
I didn't really understand half of it, but I it worked whats "-e" "-pi" "{}" for?
__________________
7 |
|
|
|
|
|
|
#5 |
|
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 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 |
|
|
|