Irish SEO,  Marketing & Webmaster Discussion

 

301 redirects displaying variables when they're not supposed to

This is a discussion on 301 redirects displaying variables when they're not supposed to within the Search Engine Optimisation forums, part of the Online Marketing category; Hello all, some-time lurker, first-time poster here. I apologise for the horrible substitution of : and . in urls with ...


Go Back   Irish SEO, Marketing & Webmaster Discussion > Online Marketing > Search Engine Optimisation

Register Forum Rules FAQDonate Calendar Search Today's Posts Mark Forums Read



Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-07-2009, 01:12 PM
Frontpage User
 
Join Date: Jul 2009
Posts: 4
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Thanks: 0
Thanked 0 Times in 0 Posts
hydrosylator will become famous soon enough
Default 301 redirects displaying variables when they're not supposed to

Hello all, some-time lurker, first-time poster here.
I apologise for the horrible substitution of : and . in urls with ; and - but you know how it is, ten posts first.

I'm upgrading a clients site to make it run smoother and use some dynamic content, and am converting it to php. I'm also aiming to improve his search engine results, most significantly initially with on-page optimisation (all error-free code, copywriting).

I'm using a .htaccess rewrite to pass page variables from urls, and that's working grand.
www-site-com/rhino-html , instead of accessing a -html file, tells the site to display a page using the information for the 'rhino' entry in the table where the stuff in each page is listed. Google toolbar shows the old Pagerank value for the page, which was associated with the old html file.

All internal links on the site have the -html extension too.

However I want to have clean urls of the type www-site-com/rhino for most of the pages, and not have a file extension.
I've already had this working, but of course want to build on the old ranks for each page, not start from scratch. My aim is to use some kind of 301 redirect, but unfortunately, this is where it gets confusing (for me).

When I go to www-site-com/rhino , I see the right content.
When I go to www-site-com/rhino-html , I see the right content.

I only want one page searched, and want it clean, so I add to htaccess:
Redirect 301 /rhino-html http;//www-site-com/rhino
Then when I go to rhino-html, I see the right content, but the address in the address bar is:
http;//www-site-com/rhino?variable=rhino-html
I think this is bad for searches, etc

I have one rewrite rule:
RewriteRule ([^/]+) index.php?variable=$1 [QSA]
This appears after the redirects.

Any suggestions? If I get this fixed, I'll add how I did it, in case anyone else has this problem, but I think they probably won't, as I'm quite new to 301's.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 08-07-2009, 03:34 PM
Frontpage User
 
Join Date: Jul 2009
Posts: 4
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Thanks: 0
Thanked 0 Times in 0 Posts
hydrosylator will become famous soon enough
Default Solved

Well, in the end I made a php statement of this nature:

Code:
if(preg_match("/.html/",variable)){
    Header( "HTTP/1.1 301 Moved Permanently" );
    Header( "Location: http;//www-site-com/".str_replace(".html","",variable)."" ); 
}
This works, because all the old pages now have corresponding database entries. It's output before any HTML is rendered, of course.

Last edited by hydrosylator; 10-07-2009 at 07:37 PM.. Reason: trying to make variables display right
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
301, displaying, redirects, supposed, variables

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
PHP form to capture variables and then email? ButtermilkJack Coding Help 3 18-07-2008 12:59 AM
Not really too sure what I'm supposed to do musicformedia Server / Technical Administration Tips and Queries 3 29-05-2008 11:47 PM
sending Ajax POST variables Ciarán Mc Cann Coding Help 22 05-10-2007 08:52 PM
Geotargetted Redirects? blacknight Coding Help 18 06-08-2006 08:39 PM


Sponsored links

Pepperjam Network
Paid On Results www.zanox.com Get Chitika Premium


All times are GMT +1. The time now is 12:06 AM.


Powered by: vBulletin Version 3.8.4, Copyright ©2000 - 2010, Jelsoft Enterprises Limited.
Hosted in Ireland by Blacknight - Test your ISP |Irish Hosting Directory| Armchair.ie|Logo by Eden Web Design|Avatars by Afterglow |Latest Blog Entries | VPS HostingAd Management by RedTyger

Search Engine Friendly URLs by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64