Domain Manage

any htaccess wizzes out there?

Discussion in 'Services Wanted' started by denchomsky, Oct 1, 2014.

Thread Status:
Not open for further replies.
  1. denchomsky United Kingdom

    denchomsky (31) Well-Known Member Trusted Trader

    Joined:
    Dec 2005
    Posts:
    1,770
    Likes Received:
    30
    Been looking for a solution to this but can find anything that specifically deals with this problem:

    I have just rebuilt a site in Wordpress for a client, I have set up a bunch of 301's in htaccess from old site to new, but any old url with a number in it doesn't work, all the ones without numbers are fine.

    example:

    /index.php/news/15/rhs redirected to http://www.domain.com/news/rhs/

    the folder/number /15/ stays in the redirected URl so it ends up:

    http://www.domain.com/news/15/rhs/

    Anyone know how to get around this?

    current mod re-write

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    Thanks
     
  2. Domain Forum

    Acorn Domains Elite Member

    Joined:
    1999
    Messages:
    Many
    Likes Received:
    Lots
     
  3. mrt United Kingdom

    mrt (1) Member New Trader

    Joined:
    May 2013
    Posts:
    18
    Likes Received:
    3
    What do your other rewrite rules look like?

    Feel free to PM with the real URLs if you'd rather keep them quiet - though it'd be nice to post an anonymised summary of the problem in the thread once sorted!
     
  4. DaveP United Kingdom

    DaveP (44) Well-Known Member Trusted Trader

    Joined:
    Mar 2010
    Posts:
    2,750
    Likes Received:
    23
    Well you need to remove the second segment (the number) from the path using a RewriteRule like this (not tested but it should be right..):

    Code:
    RewriteRule ^(.*?)/?([0-9]+)(.*)$ /$1$2
     
  5. denchomsky United Kingdom

    denchomsky (31) Well-Known Member Trusted Trader

    Joined:
    Dec 2005
    Posts:
    1,770
    Likes Received:
    30
    Thanks for the help Dave, but in the end it was a browser issue and nothing to do with the redirect.

    There was one redirect where the destination URL was wrong, so it was not getting completed properly, it sounds a bit bizarre, but it seems like Firefox had cached this folder structure, and whenever I tried a URL with the same amount of directories with a number folder it processed it the same way as the broken one.

    I cleared the cache several times, so don't know how it stored this error.

    I tried all the redirects in Chrome (something I probably should have done first before spending 3 hours looking for a solution on Stack Overflow) and they all worked fine, so this is the only explanation I have?
     
Thread Status:
Not open for further replies.

Share This Page