www.webdeveloper.com
Page 1 of 3 123 LastLast
Results 1 to 15 of 34

Thread: [RESOLVED] URGENT help needed: .htaccess not forwarding!

  1. #1
    Join Date
    Sep 2003
    Posts
    301

    resolved [RESOLVED] URGENT help needed: .htaccess not forwarding!

    Apache linux server hosted on GoDaddy, I have an .htaccess file that points old URLs to new URLs as we just rebuilt the site. It does not work as hit an old page and you just get the 404 page and not redirected to the new page location. I fear, if we do not get on this quick, we will loose SE placement for links we have in the search engines.

    here is the first part of the file.. it has about 20 more lines exactly the same. do you see an error? I do not. Seems perfectly setup. This must be some server issue, no? Thoughts?

    PHP Code:
    Redirect 301 index.html http://www.website.com/index.php
    Redirect 301 about/articles.html http://www.website.com/about/press.php
    Redirect 301 about/certs.html http://www.website.com/about/certificates.php
    Redirect 301 about/index.html http://www.website.com/about/index.php
    Redirect 301 about/mems.html http://www.website.com/about/index.php
    Redirect 301 contact/area.html http://www.website.com/contact/index.php
    Redirect 301 contact/index.html http://www.website.com/contact/index.php
    Redirect 301 faqs/index.html http://www.website.com/index.php 
    all this is in a txt file with name .htaccess.txt and then FTP to the server and then rename to .htaccess where it becomes invisible. Though, I do use an FTP app that allows me to see invisible files. So, I know it is there, name is correct.
    Last edited by etard; 11-18-2009 at 04:08 PM.

  2. #2
    Join Date
    Jun 2008
    Location
    Europe
    Posts
    1,114
    YOU MUST NOT SAVE IT AS .htaccess.txt

    JUST .htaccess


    The file has no name.
    If you are editing it in Notepad, make sure to set the file name as simply this:

    .htaccess


    Make sure that you save it as ALL FILES, NOT TEXT!!!!

    AGAIN:
    NO NO NO: .htaccess.txt
    YES! .htaccess
    Last edited by donatello; 11-18-2009 at 04:02 PM. Reason: clarification

  3. #3
    Join Date
    Sep 2003
    Posts
    301
    I use a mac, so I open TextEdit and then save - Unicode UTF-8 - it to the desktop as .htaccess - but "." is reserved for system files, so I have to use an app that lets me see hidden files on the desktop. I can then grab it and carry it to the server.

    btw, are you understanding that it is NOT on the server as .htaccess.txt?? I just save it that way locally so I can work on it because of above issue. once I transfer it to the server, I rename it to just .htaccess
    Last edited by etard; 11-18-2009 at 04:09 PM.

  4. #4
    Join Date
    Jun 2008
    Location
    Europe
    Posts
    1,114
    I remember for godaddy, there were different ways of writing them...

    Hang on... I did one for godaddy that redirected all old/dead pages to the homepage instead of a 404

    Here is my .htaccess that works on Godaddy to redirect all dead pages to our homepage instead:

    Code:
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    Last edited by donatello; 11-18-2009 at 04:15 PM.

  5. #5
    Join Date
    Sep 2003
    Posts
    301
    as expected.. I went over to a PC and did it the way you said.. does not work. One can make an .htaccess file on a mac or pc. TextEdit or Notepad should not matter. also, I think you helped me with a php issue I had that required a .htaccess file and I made like I made this first one and it worked fine. but in this case.. it is not working. almost makes me wonder if it is a server issue.

  6. #6
    Join Date
    Sep 2003
    Posts
    301
    Quote Originally Posted by donatello View Post
    I remember for godaddy, there were different ways of writing them...

    Hang on... I did one for godaddy that redirected all old/dead pages to the homepage instead of a 404

    Here is my .htaccess that works on Godaddy to redirect all dead pages to our homepage instead:

    Code:
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    but that is a full site redirect, why wouldn't you want to do page by page, one by one and get the pages sent to their correct new page and not generically the home page. I mean, if it is a custom 404 page or the home page, does that really matter? the goal would be to get old pages sent to their new page location, no?

  7. #7
    Join Date
    Jun 2008
    Location
    Europe
    Posts
    1,114

    Red face

    My script was for after we discarded a lot of old stuff, such as old newsletters taken offline, etc.


    I remember that there was a slightly different rewrite for godaddy for some reason...

    Sorry I cannot be of much more help...


    Maybe search for a Godaddy specific solution for this. Add "Godaddy" to your search string... there must be something out there at hand...

  8. #8
    Join Date
    Sep 2003
    Posts
    301
    when I use your method, it redirects to the home page BUT the page does not load the CSS file and so the page is just text. if I go back to my version, it allows the nice custom 404 page to be found, but does not redirect them to the right new page!! how is that even possible. it is like the .htaccess file is recognized, since your kicked it over to the splash page al right, but something is whack in that the splash page has no css and yet my version kicks them to the 404 page which looks perfect, but does not kick them to the correct NEW page.

  9. #9
    Join Date
    Jun 2008
    Location
    Europe
    Posts
    1,114
    Quote Originally Posted by etard View Post
    as expected.. I went over to a PC and did it the way you said.. does not work. One can make an .htaccess file on a mac or pc. TextEdit or Notepad should not matter. also, I think you helped me with a php issue I had that required a .htaccess file and I made like I made this first one and it worked fine. but in this case.. it is not working. almost makes me wonder if it is a server issue.
    I would be willing to bet it's a GODADDY issue,

    but do not despair, you can get EVERYTHING to work on Godaddy...

    sometimes it takes an alternate .htaccess file, or a php.ini file.

  10. #10
    Join Date
    Jun 2008
    Location
    Europe
    Posts
    1,114
    Did you try:
    HTML Code:
    RewriteEngine on
    rewritecond &#37;{http_host} ^coolexample.com [nc]
    rewriterule ^(.*)$ http://www.coolexample.com/$1 [r=301,nc]

  11. #11
    Join Date
    Jun 2008
    Location
    Europe
    Posts
    1,114
    Quote Originally Posted by etard View Post
    when I use your method, it redirects to the home page BUT the page does not load the CSS file and so the page is just text. if I go back to my version, it allows the nice custom 404 page to be found, but does not redirect them to the right new page!! how is that even possible. it is like the .htaccess file is recognized, since your kicked it over to the splash page al right, but something is whack in that the splash page has no css and yet my version kicks them to the 404 page which looks perfect, but does not kick them to the correct NEW page.
    Strange, works fine on a page I put it on (not mine)...

    Check it out here:
    http://www.gladstonellc.com

    You can write any jibberish after the URL and it will go to the homepage... with a message that the page you seek has been moved...
    http://www.gladstonellc.com/yada-yada

    For this site, this was a perfect solution as much old and dated material was finally cleared out for new content... old company newsletters, photos, etc.

    Works.
    Last edited by donatello; 11-18-2009 at 04:34 PM. Reason: spelling :(

  12. #12
    Join Date
    Sep 2003
    Posts
    301
    Quote Originally Posted by donatello View Post
    My script was for after we discarded a lot of old stuff, such as old newsletters taken offline, etc.


    I remember that there was a slightly different rewrite for godaddy for some reason...

    Sorry I cannot be of much more help...


    Maybe search for a Godaddy specific solution for this. Add "Godaddy" to your search string... there must be something out there at hand...
    I contacted GD... and drum roll... they will not support or give .htaccess information!!

    google the topic and you will see that GD is a known PITA on this topic.
    Last edited by etard; 11-18-2009 at 04:43 PM.

  13. #13
    Join Date
    Sep 2003
    Posts
    301
    Quote Originally Posted by donatello View Post
    Did you try:
    HTML Code:
    RewriteEngine on
    rewritecond %{http_host} ^coolexample.com [nc]
    rewriterule ^(.*)$ http://www.coolexample.com/$1 [r=301,nc]
    same result as mine.. gives me the default custom 404 page, but not the splash page

  14. #14
    Join Date
    Jun 2008
    Location
    Europe
    Posts
    1,114
    Never mind

    Our posts crossed in cyberspace... deleted mine as it would confuse...
    Last edited by donatello; 11-18-2009 at 04:40 PM. Reason: never mind...

  15. #15
    Join Date
    Jun 2008
    Location
    Europe
    Posts
    1,114
    BINGO!!!!

    I remember!!!

    Wait until the TOP OF THE HOUR!!!
    I forgot all about this as it drove me MAD once!!!

    Go and have a beer or coffee and come back at 1 minute after the hour...




    NOTE: Due to server caching, new .htaccess files may take up to one hour to be recognized.
    Changes to existing .htaccess files are picked up immediately.
    http://help.godaddy.com/article/1641?isc=isc_code

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles