Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

htaccess help


cclayton

Recommended Posts

I cant seem to get my htaccess code right for redirecting pages that appear like the below to go to a 410 page, eg:

 

www.domain.com/-c-23.html

www.domain.com/-c-12.html

www.domain.com/-c-755.html

 

Basically, I want a rule whereby anything where "-c-" comes directly after the slash of the domain gets sent to a 410. I have been trying to do this but my code isnt working, so far I have something like this:

 

RewriteRule ^/\-c\-[0-9]+\.html$ - [G]

 

But this makes no difference at all, any idea why this is not working? Thanks!

 

Chris

Founder & Director at CSC Tours Ltd

Link to comment
Share on other sites

In a RewriteRule, there will be no leading "/" on the URI. Try

RewriteRule ^-c-([0-9]+)\.html$ ......

The () will let you capture the number as $1 if you want to use it in the replacement string.

 

I'm not familiar with the "-" replacement or the G flag... should they give you a 410 error? Maybe try redirecting to something else first, just to make sure the pattern match is working:

RewriteRule ^-c-([0-9]+)\.html$  /catalog/index.php?glotz=$1  [L]

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...