Forum Moderators: phranque

Message Too Old, No Replies

Why do These Odd URLs Work?

         

greennature

12:46 am on Nov 21, 2005 (gmt 0)



Checking my logs, I've notices that odd urls are showing up, i.e.,

domain.com/article2053.html-22k[url][/
domain.com/article23.htmltravel/

and they all work, going to can go to the real page, i.e.,

article2053.html or
article23.html

why are they showing up and how can I make them all return a 404 error? They seem to create duplicte content pages.

jd01

12:52 am on Nov 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Why are they showing up?
Don't know -- how are they created?
dynamic? static? is there mod_rewrite involved?

How to remove them?
If they are static delete them from the server.
If they are dynamic, you will need to edit the script that creates them, or the mod_rewrite rules (if they are in place) to not serve the information any longer.

Not really sure what else we can advise without more information.

Justin

greennature

1:04 am on Nov 21, 2005 (gmt 0)



There is a mod rewrite involved...
RewriteRule ^(article([0-9]+)\.html) index.php?/$1 [L,QSA]

should it be
RewriteRule ^(article([0-9]+)\.html$) index.php?/$1 [L,QSA]

with the "$" denoting the end of the string?

jd01

1:17 am on Nov 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, that should do it... The other url's will not match the pattern, so this should stop the redirect, and generate a 404.

Justin

greennature

1:18 am on Nov 21, 2005 (gmt 0)



well, that seems to have worked, does it look right?

greennature

1:23 am on Nov 21, 2005 (gmt 0)



Sorry Justin, we posted at the same time. It does return a 404.

jake66

6:57 am on Nov 21, 2005 (gmt 0)

10+ Year Member



i'm having a similar problem.. it's producing:

Rings__Girls+Shirts.html

when
Rings.html -legit
Girls+Shirts.html -legit

my htaccess:
one var:
RewriteRule ^/?(category)/([^/]*)\.html$ index.php?cPath=$2&%{QUERY_STRING} [NC]

two var:
RewriteRule ^/?(category)/(.*)\.html$ product_info.php?cPath=$2&products_id=$4&%{QUERY_STRING} [NC]