|
|||||||
| Server Management Apache, Windows, .htaccess, and more |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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:
Last edited by etard; 11-18-2009 at 05:08 PM. |
|
#2
|
||||
|
||||
|
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 05:02 PM. Reason: clarification |
|
#3
|
|||
|
|||
|
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 05:09 PM. |
|
#4
|
||||
|
||||
|
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 05:15 PM. |
|
#5
|
|||
|
|||
|
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
|
|||
|
|||
|
Quote:
|
|
#7
|
||||
|
||||
|
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
|
|||
|
|||
|
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
|
||||
|
||||
|
Quote:
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
|
||||
|
||||
|
Did you try:
HTML Code:
RewriteEngine on
rewritecond %{http_host} ^coolexample.com [nc]
rewriterule ^(.*)$ http://www.coolexample.com/$1 [r=301,nc]
|
|
#11
|
||||
|
||||
|
Quote:
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 05:34 PM. Reason: spelling :( |
|
#12
|
|||
|
|||
|
Quote:
google the topic and you will see that GD is a known PITA on this topic. Last edited by etard; 11-18-2009 at 05:43 PM. |
|
#13
|
|||
|
|||
|
same result as mine.. gives me the default custom 404 page, but not the splash page
|
|
#14
|
||||
|
||||
|
Never mind
Our posts crossed in cyberspace... deleted mine as it would confuse... Last edited by donatello; 11-18-2009 at 05:40 PM. Reason: never mind... |
|
#15
|
||||
|
||||
|
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... Quote:
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|