Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page accessible by more than one URL with Fancy URLs ON #23

Closed
GoogleCodeExporter opened this issue Aug 8, 2015 · 5 comments
Closed

Comments

@GoogleCodeExporter
Copy link

A page with Fancy URLs turned on is accessible by more than one way:

http://domain.com/page1/
http://domain.com/admin/page1/
http://domain.com/asdf/fewi438923/dnwidsds/FS/page1/

It is because we don't check for parent when processing a requested page_id. 

Original issue reported on code.google.com by ccagle8 on 18 Jan 2010 at 9:15

@GoogleCodeExporter
Copy link
Author

One of the things I did was change my .htaccess to read the following:

RewriteRule ^([A-Za-z0-9-]+/)?([A-Za-z0-9-]+)/?$ index.php?id=$2 [L,QSA]

This will allow only a maximum number of 2 slugs. Doesn’t fix it in any other 
way
though, as GetSimple will still need a check whether the first one is the 
parent slug
or not. Another thing is that you will no longer be sure that wrong URLs are 
send to
your 404, this because URLs with more than 2 slugs will not be rewritten at all 
and
will be fed the server’s 404.

Do you think we actually need a check on the URL? Having a canonical URL 
specified on
the page would fix the problem as far as SEO is concerned, right?

Original comment by martijn.personal@gmail.com on 20 Feb 2010 at 9:37

@GoogleCodeExporter
Copy link
Author

Can we rely on canonical though? Duplicate content is something people will 
always be 
concerned with. But that said - i am not sure this problem is worth the amt of 
work it 
will be to check each page request that comes in for a correct parent.

Original comment by ccagle8 on 21 Feb 2010 at 12:36

@GoogleCodeExporter
Copy link
Author

This should not be much work. You just would have to add some check in 
index.php, 
something like this:

if($_SERVER['REQUEST_URI'] != $data_index->parent . '/' . $data_index->url)
header('Location: ' . $data_index->parent . '/' . $data_index->url);

Of course you should do add something else for sites that are not hosted in the 
root 
of the domain, and the extra query string parameters.

Original comment by mel...@gmail.com on 29 Mar 2010 at 4:15

@GoogleCodeExporter
Copy link
Author

This issue was closed by revision r136.

Original comment by ccagle8 on 17 Apr 2010 at 2:44

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Thanks Melado - It's taken me a while, but a version of what you gave me worked 
perfectly. Thanks!

Original comment by ccagle8 on 17 Apr 2010 at 2:45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant