Jump to content

Mass redirection not working... WEIRD ?


fbemo

Recommended Posts

Hi guys,

 

I'm trying to create mass redirection as I keep on masking my own URLs.

Below is the PHP Code:

 

<?php
$data = file('data.txt');
for ($i=0; $i<count($data); $i++) {
$line = split("	",trim($data[$i]));
if ($line[0]==$_REQUEST["goto"]) {
	header("Location: ".$line[1]);
	break;
};
};
?>

 

 

The data.txt file is below:

 

 

Meaning, when people go to http://www.this-is-my-web.com/redirect1, it will go to http://www.gotothisweb1.com. So forth;

 

Is there anything I need to create such as .htaccess file?

 

 

From this, it will make my work easier because when I need to create redirection, I just need

to add URL to data.txt file.

 

Thanks

Link to comment
Share on other sites

Yes, search google for something like

htaccess SEO friendly link

 

 

HTH

Teamatomic

 

Been looking for this before, but most of it not showing how to do mass redirection.

Thanks anyway :)

 

Your definition of mass redirection is flawed.

    http://www.this-is-my-web.com/redirect2 will redirect to http://www.gotothisweb2.com
    http://www.this-is-my-web.com/redirect3 will redirect to http://www.gotothisweb3.com
    http://www.this-is-my-web.com/redirect4 will redirect to http://www.gotothisweb4.com

 

Is what you want?

 

#301 = Temp, 302 = Permanent
Redirect 301 /redirect1 http://www.gotothisweb1.com
Redirect 301 /redirect2 http://www.gotothisweb2.com
Redirect 301 /redirect3 http://www.gotothisweb3.com
Redirect 301 /redirect4 http://www.gotothisweb4.com

 

I assume this is what you want to do, in .htaccess

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.