Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member sneader's Avatar
    Join Date
    Aug 2003
    Location
    La Crosse, WI
    Posts
    932
    cPanel/Enkompass Access Level

    Root Administrator

    Default Need Apache .htaccess rewrite help

    Googlebot is really loading one of my servers, hitting some strange URLs for one particular customer (poorly written shopping cart). A new cart is being investigated, meanwhile I thought we could simply try to catch these bad URLs and redirect them to the home page or something.

    However, the "gotcha" is that these are HTTPS URLs, and you cannot use {REQUEST_URI} on HTTPS.

    For example, here's a bad URL it's trying to hit:

    https://www.example.com/cart/https://www.example.com/cart/checkout/selectAddressshop/Blow-Out-Deal!-Extra-Loud-Alarm-Clock-with-Green-LED-3-for-19-99-Shipped.207Acer-KG-UXH1P-Dual-Band-VHF-Plus-200-MHZ-Handheld-220-Special!-129-95-Shipped-With-Programming-Cable-and-Software!.137shop/Accessories.23YT34010X3-SMA-FEMALE-to-UHF-female-Fits-Sony-and-more.221acer.info.htmlorder?returnPath=

    If this wasn't HTTPS, I'd do something like:

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^example.com$
    RewriteCond %{REQUEST_URI} ^/cart/https
    RewriteRule ^(.*)$ http://www.example.com/cart/$1 [R=301,L]

    The syntax may not be right, but what I'm trying to is say... if anyone tries to go to a URL that starts with /cart/https.... that is bogus and redirect them.

    But {REQUEST_URI} doesn't work with HTTPS.

    Any ideas, either to solve this, or where to go for a "consultant" to help figure out a workaround?

    - Scott

  2. #2
    bhd
    bhd is offline
    Member
    Join Date
    Sep 2003
    Location
    JNB ZA
    Posts
    144

    Default Re: Need Apache .htaccess rewrite help

    Google honors the robots.txt file as far as I know. Can't you put what you want in there?

  3. #3
    Member sneader's Avatar
    Join Date
    Aug 2003
    Location
    La Crosse, WI
    Posts
    932
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Need Apache .htaccess rewrite help

    Well, the problem with using robots.txt is that you'd have to enter something like:

    Disallow: /cart/https://www.example.com/

    I'll try it, but it just doesn't look like something it will understand, does it?

    - Scott

  4. #4
    Member sneader's Avatar
    Join Date
    Aug 2003
    Location
    La Crosse, WI
    Posts
    932
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Need Apache .htaccess rewrite help

    In Webmaster Tools, you can test your robots.txt file. I have "Disallow: /cart/https://www.example.com/" in robots.txt. When I feed the tester this URL:

    It says "Not in Domain".

    When I feed it the same URL, but I change the beginning from https to http, then it says "blocked by robots.txt"

    So... I'm sunk. It appears there is NO WAY to control what Google spiders, if it decides to use HTTPS to hit your site.

    That just seems wrong. How do I contact this Matt Cutts guy?

    - Scott

Similar Threads & Tags
Similar threads

  1. WHM/cPanel/Server crashes with .htaccess rewrite rule
    By pauleycreative in forum New User Questions
    Replies: 0
    Last Post: 08-10-2011, 04:13 AM
  2. Apache 2.2 rewrite and .htaccess
    By helper in forum New User Questions
    Replies: 4
    Last Post: 10-11-2007, 09:06 AM
  3. php4+php5(cgi)+htaccess(rewrite) problem
    By euroxsw in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 05-10-2006, 03:35 AM
  4. rewrite via htaccess
    By Host4u2 in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 11-06-2005, 06:27 PM
  5. .htaccess and rewrite function....
    By craigbrass in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 06-05-2004, 08:03 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube