Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2010
    Posts
    21
    Plugin Contributions
    0

    Default 301 Redirect using PHP

    I need to redirect some pages. I want to add PHP to a product page to redirect to a different page. How do I do this?

  2. #2
    Join Date
    Jul 2010
    Posts
    21
    Plugin Contributions
    0

    Default Re: 301 Redirect using PHP

    I am overhauling my website and changing to Wordpress. Each current product page needs to be redirected to the new page to maintain SEO.

  3. #3
    Join Date
    Nov 2009
    Location
    UK
    Posts
    1,090
    Plugin Contributions
    0

    Default Re: 301 Redirect using PHP

    Why not use something like this in your .htaccess...

    Im using this to redirect the new products page (which is part of an index.php string) to a completely different page.

    So even though, every page has the root page of index.php, its only redirecting the ones with certain strings, which of course you could do with individual product pages.

    RewriteEngine On
    RewriteCond %{QUERY_STRING} ^main_page=products_new$ [NC]
    RewriteRule index.php http://www.mysite.com/index.php?main...index&cPath=77

  4. #4
    Join Date
    Jul 2010
    Posts
    21
    Plugin Contributions
    0

    Default Re: 301 Redirect using PHP

    Will rewrite in htaccess do same as Redirect 301 from SEO purposes? I do not know htacess commands. What would the structure be for:

    rootdirectory/oldfile to rootdirectory/subdirectory/newfilename

  5. #5
    Join Date
    May 2010
    Location
    WA State
    Posts
    1,678
    Plugin Contributions
    3

    Default Re: 301 Redirect using PHP

    Quote Originally Posted by tpiccirillo View Post
    Will rewrite in htaccess do same as Redirect 301 from SEO purposes? I do not know htacess commands.
    It will if you add [R=301] to the end of the second line.

 

 

Similar Threads

  1. 301 redirect from html to php?
    By BillNally in forum General Questions
    Replies: 12
    Last Post: 31 Jul 2010, 11:43 PM
  2. How to redirect a pseudo-static page using a 301 redirect ?
    By anahong in forum General Questions
    Replies: 1
    Last Post: 23 Jul 2010, 02:37 PM
  3. Using 301 Redirect with SSU
    By NBordeau in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 1 May 2010, 11:05 PM
  4. Replies: 14
    Last Post: 2 Jul 2008, 03:40 PM
  5. 301 Redirect using windows
    By helpme in forum General Questions
    Replies: 1
    Last Post: 19 Jul 2007, 08:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg