PDA

View Full Version : Changed domains, looking for a hack


MuSuL
05-13-2009, 11:58 PM
I changed my domain and I'm looking for a hack that will take all my internal links (i.e. links in a thread that point to another thread on my forum) and change it to the new domain name.

Does something like this exist?

fattony69
05-14-2009, 12:46 AM
Seems like all you need is .htaccess

MuSuL
05-14-2009, 12:49 AM
I don't have access to the old domain.

Is there something I can do on the new one? Can you explain?

fattony69
05-14-2009, 02:47 AM
Oh, you don't have access to the other domain?

You are going to have a problem. You need that. You put an .htaccess file to redirect users, but since you don't have it, you can't do that. You might not be able to do anything.

veenuisthebest
05-14-2009, 04:03 AM
lol if you don't own the older domain now, how can you control it. As said above, you have to park the old domain and with few lines of htaccess rewrites its really easy to do.

COBRAws
05-18-2009, 03:15 AM
Hey guys, his problem is that he needs the posted links (links to other parts of his forum) to update those URL's with the new domain.

MuSuL, you will have to do a search and replace kinda thing, the only possible solution would be to go phpMyAdmin and do it thru there.

snakes1100
05-18-2009, 01:24 PM
Hey guys, his problem is that he needs the posted links (links to other parts of his forum) to update those URL's with the new domain.


MuSuL, you will have to do a search and replace kinda thing, the only possible solution would be to go phpMyAdmin and do it thru there.

There is no need to go into PMA and change anything as your directing, the answer was given already, a simple htaccess rewrite rule of the old domain will suffice.

@MuSul, post in the programming section and see if someone will help you write the needed htaccess rewrite rule or post in the paid job forum for a paying job if no one will do it for free.

MuSuL
05-18-2009, 03:59 PM
I had gone ahead and edited all 1200 of them. I was thinking on writing a piece of code but it only took 2 hours to do it manually. No biggie.

What would the .htaccess file have looked like? I don't have experience with them.

UKBusinessLive
05-18-2009, 05:43 PM
I had gone ahead and edited all 1200 of them. I was thinking on writing a piece of code but it only took 2 hours to do it manually. No biggie.

What would the .htaccess file have looked like? I don't have experience with them.

An Example .htaccess file looks something like this


Options +FollowSymLinks
RewriteEngine on

RewriteCond %{HTTP_HOST} ^www.old-domain.com$ [NC]
RewriteRule ^(.*)$ http://www.new-domain.com/$1 [R=301,L]



That would delivert all traffic from the "old" domain to the "new

Just edit the above and save it to your desktop as htaccess.txt

Then upload this file to your root directory, once there rename it to .htaccess

Notice where the dot is and that the .txt has now disappered, thats it :D