Rewriterule Dupe content problem

This is a discussion on "Rewriterule Dupe content problem" within the Search Engine Optimization (SEO) section. This forum, and the thread "Rewriterule Dupe content problem are both part of the Promote Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Promote Your Website > Search Engine Optimization (SEO)

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Oct 21st, 2007, 21:40
alexgeek's Avatar
Moderator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,812
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Rewriterule Dupe content problem

In Rob's warning thread:
http://www.webforumz.com/webforumz-c...your-sites.htm

It tells us that the rewrite rules can be exploited.
But how can you counter this?

my rule is something like this:
Code: Select all
RewriteRule ^blog/([0-9]+)-[a-zA-Z-]+$ blog.php?id=$1 [L]
which means all the following will work:
7-contact-lenses
7-Contacts
7-lallalalla

How can I stop this so that only the first will work? Via PHP somehow?
Help very much appreciated.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)

Last edited by alexgeek; Oct 22nd, 2007 at 07:07.
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  
Old Oct 22nd, 2007, 04:03
Highly Reputable Member
Join Date: Apr 2007
Location: Willich, Germany
Age: 20
Posts: 593
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Rewriterule Dupe content problem

You could use PHP or just change the rule like so:
Code: Select all
 RewriteRule ^blog/([0-9]+)-[a-zA-Z]+$ blog.php?id=$1 [L]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Oct 22nd, 2007, 07:08
alexgeek's Avatar
Moderator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,812
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: Rewriterule Dupe content problem

Jan, I don't see what's different in that rule or how it will stop duplicate content.


I think I should of been more clear, I only want one string to work per string like so:
1-welcome
2-web-development
etc.

But then I want the following to not work (or redirect to the real one (1-welcome))
1-web-design

Otherwise, for 1-welcome and 1-web-design, the same page will be brought up and indexed by google twice meaning I get dupe content
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)

Last edited by alexgeek; Oct 22nd, 2007 at 07:12.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Oct 22nd, 2007, 08:19
Highly Reputable Member
Join Date: Apr 2007
Location: Willich, Germany
Age: 20
Posts: 593
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Rewriterule Dupe content problem

HE? I don't quite understand what you want....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Oct 22nd, 2007, 10:48
alexgeek's Avatar
Moderator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,812
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: Rewriterule Dupe content problem

Did you check the link in my first post?
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Oct 22nd, 2007, 10:55
Highly Reputable Member
Join Date: Apr 2007
Location: Willich, Germany
Age: 20
Posts: 593
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Rewriterule Dupe content problem

yes. what does the link have to do with your rewrite rule?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Oct 22nd, 2007, 11:10
alexgeek's Avatar
Moderator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,812
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: Rewriterule Dupe content problem

Because if I have:
/blog/7-welcome
The following will also work:
/blog/7-duplicate
/blog/7-anything-can-go-here

So if people were to link to my blog via those links, google would index them as duplicate content.
Hope that makes sense
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Oct 22nd, 2007, 14:57
Highly Reputable Member
Join Date: Apr 2007
Location: Willich, Germany
Age: 20
Posts: 593
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Rewriterule Dupe content problem

Well, the answer to your question is to be found in Rob's post - make your pages "self-aware of their own URL's". I would use PHP to catch this.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Oct 22nd, 2007, 15:02
alexgeek's Avatar
Moderator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,812
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: Rewriterule Dupe content problem

How can you check what is used to access the page then?
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Oct 22nd, 2007, 16:37
Highly Reputable Member
Join Date: Apr 2007
Location: Willich, Germany
Age: 20
Posts: 593
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Rewriterule Dupe content problem

$_SERVER['QUERY_STRING'] or $_SERVER['REQUEST_URI'].
not quite sure which. check this out...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Oct 22nd, 2007, 16:45
alexgeek's Avatar
Moderator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,812
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: Rewriterule Dupe content problem

Thanks will try now
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12  
Old Oct 22nd, 2007, 16:48
alexgeek's Avatar
Moderator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,812
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: Rewriterule Dupe content problem

Incase anyone wants to do the same, it's
PHP: Select all

$_SERVER['REQUEST_URI']; 

Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
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

Thread Tools

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
100% height on content problem jasonmillward Web Page Design 1 Apr 9th, 2008 14:08
centering my content in IE (yet another problem) bengtec Web Page Design 7 Sep 26th, 2007 23:24
Center content problem Aaron1988 Web Page Design 1 Mar 20th, 2007 20:03
IE active content flash validation problem edd_jedi Flash & Multimedia Forum 5 Jul 20th, 2006 23:01


All times are GMT. The time now is 06:53.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

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