Results 1 to 9 of 9
  1. #1
    baldidiot is offline Private Member
    Join Date
    January 2010
    Posts
    5,015
    Thanks
    429
    Thanked 2,291 Times in 1,526 Posts

    Default Domain redirect / htaccess question

    We're currently in the process of taking a bunch of old mini sites and combining into one larger site, but having issues with the 301 redirect on one of them.

    This is what we're using, which has worked fine in the past on other sites, but for some reason on this particular site it's only redirecting the home page - sub pages are going to the old site.

    Anyone spot an error we're missing?

    Code:
    RewriteEngine onRewriteCond %{HTTP_HOST} !^(www\.casinobonusesonline\.org.uk)?$
    RewriteRule (.*) http://www.ukbettingsites.org.uk/$1 [R=301,L]
    Should be redirecting casinobonusesonline.org.uk to ukbettingsites.org.uk, which it does for the home page, but all sub pages stay on the old domain so guessing there's a syntax error or something? Htaccess isn't my strong suit...
    onlinegamblingwebsites.com - Formally known as goodbonusguide.

    Gambling Domains: Small clear out of some of the domains we've been hoarding on Dan - see the list here. Prices negotiable, and willing to swap for decent links.

  2. #2
    Progger's Avatar
    Progger is offline Public Member
    Join Date
    November 2014
    Location
    New Zealand
    Posts
    1,422
    Thanks
    282
    Thanked 927 Times in 581 Posts

    Default

    im 99% sure u can config a redirect on your "host-panel"

    or...

    RewriteRule ^(.*)$ http://www.ukbettingsites.org.uk%{REQUEST_URI} [R=301,L]

  3. #3
    baldidiot is offline Private Member
    Join Date
    January 2010
    Posts
    5,015
    Thanks
    429
    Thanked 2,291 Times in 1,526 Posts

    Default

    Quote Originally Posted by Progger View Post
    im 99% sure u can config a redirect on your "host-panel"
    Tried that first, didn't work. Only did the home page (which makes me wonder if it's something else on site causing it).



    Quote Originally Posted by Progger View Post
    RewriteRule ^(.*)$ http://www.ukbettingsites.org.uk%{REQUEST_URI} [R=301,L]
    Nope
    onlinegamblingwebsites.com - Formally known as goodbonusguide.

    Gambling Domains: Small clear out of some of the domains we've been hoarding on Dan - see the list here. Prices negotiable, and willing to swap for decent links.

  4. #4
    baldidiot is offline Private Member
    Join Date
    January 2010
    Posts
    5,015
    Thanks
    429
    Thanked 2,291 Times in 1,526 Posts

    Default

    Well... I'm not sure what I did but it's working now, so problem solved (just don't ask me how I did it as I have no clue).
    onlinegamblingwebsites.com - Formally known as goodbonusguide.

    Gambling Domains: Small clear out of some of the domains we've been hoarding on Dan - see the list here. Prices negotiable, and willing to swap for decent links.

  5. The Following User Says Thank You to baldidiot For This Useful Post:

    -Shay- (20 July 2017)

  6. #5
    Join Date
    November 2005
    Posts
    4,510
    Blog Entries
    1
    Thanks
    1,920
    Thanked 2,216 Times in 1,278 Posts

    Default

    My server was upgrade from Apache 2.2 to 2.4, while the upgrade adds New Features, it can have a negative impact on previous htaccess syntax. It's supposed to be backward compatible (least I believe so).

    But in some instances such as, Deny From All, Allow From xxx.xxx.xxx.xxx, it no longer works for me. Instead, I've had to impliment the new 2.4 syntax: Reqiured IP xxx.xxx.xxx

    Pain in the ass frankly. Especially as it seems some old syntax's are working, while others are not.

  7. The Following User Says Thank You to Former Member 14 For This Useful Post:

    -Shay- (20 July 2017)

  8. #6
    universal4's Avatar
    universal4 is offline Forum Administrator
    Join Date
    July 2003
    Location
    Courage is being scared to death...and saddling up anyway. John Wayne
    Posts
    32,338
    Thanks
    3,819
    Thanked 8,772 Times in 5,598 Posts

    Default

    Glad it is working now baldidiot.

    To be sure any time you are attempting htaccess changes, be sure to keep changing browsers to make your tests as the cache (both browser or web server cache) can affect changes to not be seen immediately. (sounds a little bit like this might have been the case)

    As an example if you are testing in Firefox, see it doesn't do what you want, make the change you want to try and then for the next test open a fresh "different" browser session IE/Chrome/Opera/etc since it should force a fresh page from the server and rule out it possibly being affected by the cache.

    Rick
    Universal4

  9. The Following User Says Thank You to universal4 For This Useful Post:

    -Shay- (21 July 2017)

  10. #7
    baldidiot is offline Private Member
    Join Date
    January 2010
    Posts
    5,015
    Thanks
    429
    Thanked 2,291 Times in 1,526 Posts

    Default

    Ah, could be. I did try on my phone as well but I may have been on it previously.

    Weird thing is that the home page did change immediately as soon as I added or removed the redirect code (I took it off to test), unless it doesn't cache the home page or something? Htaccess is something I've never really properly gotten my head around.

    At the same time though I did try a bunch of different things and different peoples code (everyone seems to do it a different way). I then ended up coming back to the one that had worked for me in the past (the one I included in my first post) and it suddenly started working as soon as I did it.
    onlinegamblingwebsites.com - Formally known as goodbonusguide.

    Gambling Domains: Small clear out of some of the domains we've been hoarding on Dan - see the list here. Prices negotiable, and willing to swap for decent links.

  11. The Following User Says Thank You to baldidiot For This Useful Post:

    -Shay- (21 July 2017)

  12. #8
    Progger's Avatar
    Progger is offline Public Member
    Join Date
    November 2014
    Location
    New Zealand
    Posts
    1,422
    Thanks
    282
    Thanked 927 Times in 581 Posts

    Default

    cache,but yes rick was faster

    best way are redirect checker like.. http://www.redirect-checker.org/

    works like a charm

  13. #9
    universal4's Avatar
    universal4 is offline Forum Administrator
    Join Date
    July 2003
    Location
    Courage is being scared to death...and saddling up anyway. John Wayne
    Posts
    32,338
    Thanks
    3,819
    Thanked 8,772 Times in 5,598 Posts

    Default

    Thanks progger, that looks pretty handy when you are working on one and a little unsure of the syntax

    Rick
    Universal4

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •