Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1

    Default 301 redirect from html to php?

    Hi all, having a problem with this, it gives me a server error when I run it. I need to do a permanent redirect and I thought adding this to the .htaccess would work,
    redirect 301 /categories/pool tables/american_pool_tables_p3.html http://www.cuepower.co.uk/index.php?...ort=20a&page=3
    I have a few pages to redirect, am I right in thinking the problem with this is in redirecting from a html page to a php page?
    thanks in advance for any help

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: 301 redirect from html to php?

    No. You can do that.

    As to why it's failing for you, you haven't provided any information about your Zen Cart, or your URL rewriting mod, or the rest of your .htaccess file, or even what the error is.

    Might it be a "can't complete" type error because you're trying to redirect the page to itself?
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3

    Default Re: 301 redirect from html to php?

    Sorry about that
    I’m just finishing a new upgrade to our site but I need to get shot of a loads of old html. The site is now up to date on 1.3.9e and I added the code after a blank line to the existing .htaccess file.
    The error without even going to a redirected page read....
    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
    More information about this error may be available in the server error log.

    You lost me with the URL rewriting mod all I added was the line of redirect code

  4. #4
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: 301 redirect from html to php?

    OK. Let's take a step back. Why are you trying to redirect this URL? The old URL does not indicate the presence of html pages, just that you can a piece of code on your site that makes your php generated pages look as they're html.

    You can stop this by turning off whatever SEO URL package you have installed.
    Last edited by kuroi; 29 Jul 2010 at 11:02 AM.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  5. #5

    Default Re: 301 redirect from html to php?

    The original site was a large mix of html from before started using zencart and the more recent zen php. The upgrade is about ready to implement and I want to reduce the html work without throwing away the SEO

  6. #6
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: 301 redirect from html to php?

    OK. But what you're trying to replace there isn't html, it's a php link that's been re-written to look like HTML. So you're sending your browser round in circles, as you try to force it to a php page and your SEO URLs package rewrites it back to look like html, in what would be a never ending process if there weren't a server error designed to stop infinite loops.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  7. #7

    Default Re: 301 redirect from html to php?

    Is there a better way to do it without loss of seo or am I doomed to doubling up work with html

  8. #8
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: 301 redirect from html to php?

    That rewriting of the links to look like html pages is most like all that your SEO module is doing for you. So your question is contradictory.

    Could you clarify what the ultimate "it" you're trying achieve is? If it's just about removing html pages that pre-date your Zen Cart, then you're attacking the wrong links.

    Using SEO URLs does tend to create double links. One being what the SEO package generates and wants search engines to see and index, and the other the underlying dynamic link.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  9. #9

    Default Re: 301 redirect from html to php?

    I think I have confused you somewhere. The SEO I meant was the page ranking and inbound links to the html pages not an SEO mod. All I need to do is permanently redirect all of that to the php page holding the relevant content for that HTML page

  10. #10
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: 301 redirect from html to php?

    OK. You can do this and to do so you would need to set up redirects for every page on your site and turn your SEO module off so that it stops rewriting the URLs back to their current format.

    But that's an awful lot of work for this result:
    - some loss of SEO benefit as your URLs would no longer contain keywords
    - a degradation in the performance of your site as the very large .htaccess file would need to be processed and the browser redirected for every page load.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. 301 Redirect using PHP
    By tpiccirillo in forum General Questions
    Replies: 4
    Last Post: 3 Mar 2012, 12:01 AM
  2. Replies: 4
    Last Post: 9 Apr 2010, 11:17 AM
  3. Can I exclude a folder from a 301 redirect?
    By beyre in forum General Questions
    Replies: 0
    Last Post: 3 Apr 2009, 02:59 AM
  4. Replies: 14
    Last Post: 2 Jul 2008, 03:40 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR