Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Sep 2009
    Location
    Des Moines, Iowa
    Posts
    8
    Member #
    19850
    Normally I can learn new tricks, commands, and codes pretty easily, but this particular one has me a little confused. My research has provided for many different ways to perform this "301 permanent redirect," which has included different formating of the commands depending on the languages or types of hosting (server side, etc.).
    I have some webpages that I've renamed from their original plain file names to some more SEO beneficial file names that include key words and phrases. Since there are several other sites (affiliates and feature articles) that reference some of these page filenames, I want to insure that those links are still valid.
    The first information I read mentioned using creating an .htaccess file and using the following format for the redirect:
    redirect 301 /old/plainfilename.htm http://www.mywebsite.com/newfilename.htm
    I left a space and repeated this format for the additional pages I needed "redirected," but this did not seem to work and further research suggested that this was valid ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled (not clear in my first reference site).
    This 301 permenanet redirect has MANY alternate formats, depending on the type of code or web language being used.
    NOW, I am trying the following code, which may or may NOT work with straight HTML. This is the instruction given:
    HTTP 301 Redirect in PHP

    I am hoping that by using the following code in the header of the web page needing to be redirected to http://www.somacon.com, I will achieve the desired results. Please forgive my ignorance, but since it mentions putting this code in the HEADER of the file being redirected, would that NOT be after the <head> tag? Can I mix the PHP command within an HTML file?
    <?php// Permanent redirectionheader("HTTP/1.1 301 Moved Permanently");header("Location:

  2.  

  3. #2
    Junior Member
    Join Date
    Sep 2009
    Location
    Des Moines, Iowa
    Posts
    8
    Member #
    19850
    It appears that my PHP command was cut off. This is what my research provided me as a format for a PHP 301 permanent redirect:
    HTTP 301 Redirect in PHP

    <?php// Permanent redirectionheader("HTTP/1.1 301 Moved Permanently");header("Location: http://www.somacon.com/");exit();?>


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 02:36 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com