Jump to content

Recommended Posts

The easiest way is to put them in your htaccess file as follows:

 

Redirect 301 /myoldpage.php  http://www.mydomain.com/index.php
Redirect 301 /anotherpage.html  http://www.mydomain.com/index.php
Redirect 301 /the oldestpage.php  http://www.mydomain.com/index.php

 

It really is as easy as that.

 

Just remember that it is absolutely crucial to save your .htaccess and FTP it as ASCI and not binary.

What server are they using?

 

What do they want to redirect? URL, old page to new page?

 

Are on windows server 2008? Windows 2003 IIS? .net? Do they use .asp pages?

 

Here are a few solutions depending upon the type:

 

IIS Redirect

    * In internet services manager, right click on the file or folder you wish to redirect
    * Select the radio titled "a redirection to a URL".
    * Enter the redirection page
    * Check "The exact url entered above" and the "A permanent redirection for this resource"
    * Click on 'Apply'

ColdFusion Redirect
<.cfheader statuscode="301" statustext="Moved permanently">
<.cfheader name="Location" value="http://www.new-url.com">

ASP Redirect
<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location","http://www.new-url.com/"
%>

ASP .NET Redirect
<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","http://www.new-url.com");
}
</script>

 

 

Old pages are HTML but new pages are PHP. Not sure what server type but it isn't Apache.

 

Well, if he uses php then it isn't Windows, either. There are dozens of web servers that php works with.

 

If he has access to the config.php file he can add something like:

if (isset($_SERVER['HTTPS']) && $_SERVER['HTTP'] == "on") {
header("Status: 301 Moved Permanently", false, 301); 
header("location: https://www.hiswebsite.com/index.html");
} else {
header("Status: 301 Moved Permanently", false, 301); 
header("location: http://www.hiswebsite.com/index.html");
}

 

Although that's bulky for individual pages. I'm sure there is an easier way.

 

I suppose he needs a regex

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.