WordPress.org

Ready to get started?Download WordPress

Forums

Did I break it by adding .htaccess? (21 posts)

  1. elizdelphi
    Member
    Posted 9 years ago #

    Hi, I am very much a newbieand I will so much appreciate whatever help anyone can offer...

    I was unable to access my website's stats after installing WordPress (gave me a "not found" message since there was nothing in the WordPress database for directory /stats/), and I read on my web host's (Dreamhost) support site that I might need to write
    RewriteCond %{REQUEST_URI} ^/stats/(.*)$
    RewriteCond %{REQUEST_URI} ^/failed_auth.html$

    to the ".htaccess" file. Apparently version 1.5 does not use .htaccess but I created a file titled .htaccess including only the above two lines and ftp'ed it to my main directory. I can access my stats now, but only the pain page and admin pages of my blog (http://www.goodponies.com) show up. Other pages give an error like "Not Found, The requested URL /category/available-for-sale/ was not found on this server., Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request." And to boot, ".htaccess" doesn't actually show up in any of the FTP programs I have tried (Internet Explorer, an old version of WSFTP LE and a new version of FTP Surfer)--though a manual request to transfer .htaccess from the webserver to my computer seems to work, whereas it doesn't work with made-up filenames. I tried transferring a blank .htaccess file, and that didn't seem to change anything--I can still access my stats, and I still can't access blog pages. I have tried manually creating a "DELE .htaccess" command in FTP Surfer and it told me it couldn't find that file.

    I feel pretty foolish, can anyone explain to me what might have happened and what I might try to fix it? Again, I am not a sophisticated user of WordPress, FTP, or anything else. I'm fairly alarmed and worried!

  2. elizdelphi
    Member
    Posted 9 years ago #

    Okay, I downloaded FileZilla and that finally let me view hidden files, including .htaccess. I deleted .htaccess, and still nothing has changed. What's still wrong?

  3. Kafkaesqui

    Posted 9 years ago #

    Remove the custom permalinks you have set up under Options > Permalinks.

  4. elizdelphi
    Member
    Posted 9 years ago #

    Oh, okay, I just regenerated the custom permalinks and it fixed it. I can see my posts and directories again! Thanks!

    But, of course my /stats/ is again a 404. Obviously what I tried with creating a .htaccess didn't work. Any thoughts on how to stop WordPress from going to its database to look for the /stats/ directory?

  5. Ming
    Member
    Posted 9 years ago #

    Did you make a page in WP called stats? If WP has a page for something then it's included in the rewrite rules and WP is used to fill that request. So if you have a page called stats, delete it and regenerate your permalinks.

  6. elizdelphi
    Member
    Posted 9 years ago #

    no, the /stats/directory is my webhost's auto-generated site stats page, only it doesn't work with WordPress because it gets preempted by WP's attempt to search its database for a /stats/ page that doesn't exist in the database.

    I've given up on that for now though, since I found a plugin, BAStats, that serves my stat needs well enough for the time being.

  7. Ming
    Member
    Posted 9 years ago #

    I'm unsure what's the problem here. I'm using Dreamhost and I can still access my stats directory. I've installed to example.com/wp/ but my blog address is example.com/. My .htaccess file is at example.com/

    I manually installed WP. I'm not sure if the 1 click install does anything different (if that's what you used).

  8. Ruby Sinreich
    Member
    Posted 8 years ago #

    I have the exact same problem with dreahost stats! Whenever I attempt to go to http://lotusmedia.org/stats I get my 404 page instead.

    I just tried adding the code you said was suggested by dreamhost to my .htaccess file, but it didn't change anything. ;-(

  9. tomhanna
    Member
    Posted 8 years ago #

    I think Kafkaesqui pointed to the solution. You'll need to disable custom permalinks as the stats directory looks to WordPress like it's a permalink. Or do as Ming did and install WP in a subdirectory.

  10. James
    Happiness Engineer
    Posted 8 years ago #

    No, I had permalinks running fine under DreamHost. The problem is that DreamHost hard-wires the stats to be displayed in the /stats/ directory. So, if you have WordPress installed in a /stats/ directory, or you have WordPress installed at the root of your domain and have creates a "Stats" page (thus placing the page at domain.com/stats/), you will cause plenty of server problems.

  11. Ruby Sinreich
    Member
    Posted 8 years ago #

    Makes sense except I don't have a "stats" page generated by WordPress. If I did, then I would get that instead of a 404 error.

    I agree that WP is trying to interpret the address as a permalink to a post, but I can't just turn off permalinks. That would mess up all incoming links to my site!

    I have a feeling this is related to my theme. But I removed the 404.php page from it and am still having this problem...

  12. James
    Happiness Engineer
    Posted 8 years ago #

    First, try disabling all plugins. If that doesn't improve things, try switching to the WordPress Default Theme (or the WordPress Classic Theme if you are already using the Default Theme).

  13. Nick Momrik
    Member
    Posted 8 years ago #

  14. TaseerDC
    Member
    Posted 8 years ago #

    I have a definite problem; when I put up a .htaccess file on my site, I couldn't even make it to the domain (it wouldn't show up anything). Is it something I put in the file itself, or is there a particular way to set up a .htaccess file? I'm using ICDSoft as my host, and the site is http://www.venialsin.com. The text of the file is below:

    </Files>setenvifnocase Referer "^http://(www\.)orkut.com" spam_ref=1
    setenvifnocase Referer "^http://(www\.)friendster.com" spam_ref=1
    setenvifnocase Referer "^http://(www\.)google.com.pk" spam_ref=1
    setenvifnocase Referer "^http://(www\.)yahoo.com" spam_ref=1
    setenvifnocase Referer "^http://(www\.)dogpile.com" spam_ref=1
    setenvifnocase Referer "^http://(www\.)askjeeves.com" spam_ref=1
    setenvifnocase Referer "^http://(www\.)lycos.com" spam_ref=1
    setenvifnocase Referer "^http://(www\.)altavista.com" spam_ref=1
    setenvifnocase Referer "^http://(www\.)hotbot.com" spam_ref=1
    setenvifnocase Referer "^http://(search\.)msn.com" spam_ref=1

    <FilesMatch "(.*)">
    Order Allow,Deny
    Allow from all
    Deny from env=spam_ref
    </FilesMatch>

    RewriteEngine On
    RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Bot\ mailto:craftbot@yahoo.com [OR]
    RewriteCond %{HTTP_USER_AGENT} ^ChinaClaw [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Custo [OR]
    RewriteCond %{HTTP_USER_AGENT} ^DISCo [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Download\ Demon [OR]
    RewriteCond %{HTTP_USER_AGENT} ^eCatch [OR]
    RewriteCond %{HTTP_USER_AGENT} ^EirGrabber [OR]
    RewriteCond %{HTTP_USER_AGENT} ^EmailSiphon [OR]
    RewriteCond %{HTTP_USER_AGENT} ^EmailWolf [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Express\ WebPictures [OR]
    RewriteCond %{HTTP_USER_AGENT} ^ExtractorPro [OR]
    RewriteCond %{HTTP_USER_AGENT} ^EyeNetIE [OR]
    RewriteCond %{HTTP_USER_AGENT} ^FlashGet [OR]
    RewriteCond %{HTTP_USER_AGENT} ^GetRight [OR]
    RewriteCond %{HTTP_USER_AGENT} ^GetWeb! [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Go!Zilla [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Go-Ahead-Got-It [OR]
    RewriteCond %{HTTP_USER_AGENT} ^GrabNet [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Grafula [OR]
    RewriteCond %{HTTP_USER_AGENT} ^HMView [OR]
    RewriteCond %{HTTP_USER_AGENT} HTTrack [NC,OR]
    RewriteCond %{HTTP_USER_AGENT} ^Image\ Stripper [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Image\ Sucker [OR]
    RewriteCond %{HTTP_USER_AGENT} Indy\ Library [NC,OR]
    RewriteCond %{HTTP_USER_AGENT} ^InterGET [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Internet\ Ninja [OR]
    RewriteCond %{HTTP_USER_AGENT} ^JetCar [OR]
    RewriteCond %{HTTP_USER_AGENT} ^JOC\ Web\ Spider [OR]
    RewriteCond %{HTTP_USER_AGENT} ^larbin [OR]
    RewriteCond %{HTTP_USER_AGENT} ^LeechFTP [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Mass\ Downloader [OR]
    RewriteCond %{HTTP_USER_AGENT} ^MIDown\ tool [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Mister\ PiX [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Navroad [OR]
    RewriteCond %{HTTP_USER_AGENT} ^NearSite [OR]
    RewriteCond %{HTTP_USER_AGENT} ^NetAnts [OR]
    RewriteCond %{HTTP_USER_AGENT} ^NetSpider [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Net\ Vampire [OR]
    RewriteCond %{HTTP_USER_AGENT} ^NetZIP [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Octopus [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Offline\ Explorer [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Offline\ Navigator [OR]
    RewriteCond %{HTTP_USER_AGENT} ^PageGrabber [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Papa\ Foto [OR]
    RewriteCond %{HTTP_USER_AGENT} ^pavuk [OR]
    RewriteCond %{HTTP_USER_AGENT} ^pcBrowser [OR]
    RewriteCond %{HTTP_USER_AGENT} ^RealDownload [OR]
    RewriteCond %{HTTP_USER_AGENT} ^ReGet [OR]
    RewriteCond %{HTTP_USER_AGENT} ^SiteSnagger [OR]
    RewriteCond %{HTTP_USER_AGENT} ^SmartDownload [OR]
    RewriteCond %{HTTP_USER_AGENT} ^SuperBot [OR]
    RewriteCond %{HTTP_USER_AGENT} ^SuperHTTP [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Surfbot [OR]
    RewriteCond %{HTTP_USER_AGENT} ^tAkeOut [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Teleport\ Pro [OR]
    RewriteCond %{HTTP_USER_AGENT} ^VoidEYE [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Web\ Image\ Collector [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Web\ Sucker [OR]
    RewriteCond %{HTTP_USER_AGENT} ^WebAuto [OR]
    RewriteCond %{HTTP_USER_AGENT} ^WebCopier [OR]
    RewriteCond %{HTTP_USER_AGENT} ^WebFetch [OR]
    RewriteCond %{HTTP_USER_AGENT} ^WebGo\ IS [OR]
    RewriteCond %{HTTP_USER_AGENT} ^WebLeacher [OR]
    RewriteCond %{HTTP_USER_AGENT} ^WebReaper [OR]
    RewriteCond %{HTTP_USER_AGENT} ^WebSauger [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Website\ eXtractor [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Website\ Quester [OR]
    RewriteCond %{HTTP_USER_AGENT} ^WebStripper [OR]
    RewriteCond %{HTTP_USER_AGENT} ^WebWhacker [OR]
    RewriteCond %{HTTP_USER_AGENT} ^WebZIP [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Wget [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Widow [OR]
    RewriteCond %{HTTP_USER_AGENT} ^WWWOFFLE [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Xaldon\ WebSpider [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Zeus
    RewriteRule ^.* - [F,L]

    Any help would be greatly appreciated!

  15. TaseerDC
    Member
    Posted 8 years ago #

    I have a definite problem; when I put up a .htaccess file on my site, I couldn't even make it to the domain (it wouldn't show up anything). Is it something I put in the file itself, or is there a particular way to set up a .htaccess file? I'm using ICDSoft as my host, and the site is http://www.venialsin.com. The text of the file is below:

    </Files>setenvifnocase Referer "^http://(www\.)orkut.com" spam_ref=1
    setenvifnocase Referer "^http://(www\.)friendster.com" spam_ref=1
    setenvifnocase Referer "^http://(www\.)google.com.pk" spam_ref=1
    setenvifnocase Referer "^http://(www\.)yahoo.com" spam_ref=1
    setenvifnocase Referer "^http://(www\.)dogpile.com" spam_ref=1
    setenvifnocase Referer "^http://(www\.)askjeeves.com" spam_ref=1
    setenvifnocase Referer "^http://(www\.)lycos.com" spam_ref=1
    setenvifnocase Referer "^http://(www\.)altavista.com" spam_ref=1
    setenvifnocase Referer "^http://(www\.)hotbot.com" spam_ref=1
    setenvifnocase Referer "^http://(search\.)msn.com" spam_ref=1

    <FilesMatch "(.*)">
    Order Allow,Deny
    Allow from all
    Deny from env=spam_ref
    </FilesMatch>

    RewriteEngine On
    RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Bot\ mailto:craftbot@yahoo.com [OR]
    RewriteCond %{HTTP_USER_AGENT} ^ChinaClaw [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Custo [OR]
    RewriteCond %{HTTP_USER_AGENT} ^DISCo [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Download\ Demon [OR]
    RewriteCond %{HTTP_USER_AGENT} ^eCatch [OR]
    RewriteCond %{HTTP_USER_AGENT} ^EirGrabber [OR]
    RewriteCond %{HTTP_USER_AGENT} ^EmailSiphon [OR]
    RewriteCond %{HTTP_USER_AGENT} ^EmailWolf [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Express\ WebPictures [OR]
    RewriteCond %{HTTP_USER_AGENT} ^ExtractorPro [OR]
    RewriteCond %{HTTP_USER_AGENT} ^EyeNetIE [OR]
    RewriteCond %{HTTP_USER_AGENT} ^FlashGet [OR]
    RewriteCond %{HTTP_USER_AGENT} ^GetRight [OR]
    RewriteCond %{HTTP_USER_AGENT} ^GetWeb! [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Go!Zilla [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Go-Ahead-Got-It [OR]
    RewriteCond %{HTTP_USER_AGENT} ^GrabNet [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Grafula [OR]
    RewriteCond %{HTTP_USER_AGENT} ^HMView [OR]
    RewriteCond %{HTTP_USER_AGENT} HTTrack [NC,OR]
    RewriteCond %{HTTP_USER_AGENT} ^Image\ Stripper [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Image\ Sucker [OR]
    RewriteCond %{HTTP_USER_AGENT} Indy\ Library [NC,OR]
    RewriteCond %{HTTP_USER_AGENT} ^InterGET [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Internet\ Ninja [OR]
    RewriteCond %{HTTP_USER_AGENT} ^JetCar [OR]
    RewriteCond %{HTTP_USER_AGENT} ^JOC\ Web\ Spider [OR]
    RewriteCond %{HTTP_USER_AGENT} ^larbin [OR]
    RewriteCond %{HTTP_USER_AGENT} ^LeechFTP [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Mass\ Downloader [OR]
    RewriteCond %{HTTP_USER_AGENT} ^MIDown\ tool [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Mister\ PiX [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Navroad [OR]
    RewriteCond %{HTTP_USER_AGENT} ^NearSite [OR]
    RewriteCond %{HTTP_USER_AGENT} ^NetAnts [OR]
    RewriteCond %{HTTP_USER_AGENT} ^NetSpider [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Net\ Vampire [OR]
    RewriteCond %{HTTP_USER_AGENT} ^NetZIP [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Octopus [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Offline\ Explorer [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Offline\ Navigator [OR]
    RewriteCond %{HTTP_USER_AGENT} ^PageGrabber [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Papa\ Foto [OR]
    RewriteCond %{HTTP_USER_AGENT} ^pavuk [OR]
    RewriteCond %{HTTP_USER_AGENT} ^pcBrowser [OR]
    RewriteCond %{HTTP_USER_AGENT} ^RealDownload [OR]
    RewriteCond %{HTTP_USER_AGENT} ^ReGet [OR]
    RewriteCond %{HTTP_USER_AGENT} ^SiteSnagger [OR]
    RewriteCond %{HTTP_USER_AGENT} ^SmartDownload [OR]
    RewriteCond %{HTTP_USER_AGENT} ^SuperBot [OR]
    RewriteCond %{HTTP_USER_AGENT} ^SuperHTTP [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Surfbot [OR]
    RewriteCond %{HTTP_USER_AGENT} ^tAkeOut [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Teleport\ Pro [OR]
    RewriteCond %{HTTP_USER_AGENT} ^VoidEYE [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Web\ Image\ Collector [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Web\ Sucker [OR]
    RewriteCond %{HTTP_USER_AGENT} ^WebAuto [OR]
    RewriteCond %{HTTP_USER_AGENT} ^WebCopier [OR]
    RewriteCond %{HTTP_USER_AGENT} ^WebFetch [OR]
    RewriteCond %{HTTP_USER_AGENT} ^WebGo\ IS [OR]
    RewriteCond %{HTTP_USER_AGENT} ^WebLeacher [OR]
    RewriteCond %{HTTP_USER_AGENT} ^WebReaper [OR]
    RewriteCond %{HTTP_USER_AGENT} ^WebSauger [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Website\ eXtractor [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Website\ Quester [OR]
    RewriteCond %{HTTP_USER_AGENT} ^WebStripper [OR]
    RewriteCond %{HTTP_USER_AGENT} ^WebWhacker [OR]
    RewriteCond %{HTTP_USER_AGENT} ^WebZIP [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Wget [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Widow [OR]
    RewriteCond %{HTTP_USER_AGENT} ^WWWOFFLE [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Xaldon\ WebSpider [OR]
    RewriteCond %{HTTP_USER_AGENT} ^Zeus
    RewriteRule ^.* - [F,L]

    Any help would be greatly appreciated!

  16. angsuman
    Member
    Posted 8 years ago #

    Remove the .htaccess file. It has too many questionable entires at first glance. Are you aware of what it exactly does and what limitations it imposes?

    You want to deny traffic from google, askjeeves, yahoo sites?

    It doesn't make any sense to me. I get 90% of my traffic from search engines.

  17. Mark (podz)
    Support Maven
    Posted 8 years ago #

    Webmasterworld has great lists of .htaccess rules like that, and they also have big wanrings that unless you know what you are doing, you should not mess with .htaccess - it's a powerful tool.

    If you add something, and your site breaks, reverse what you did ?

    And before you do anything else, decide exactly what it is you are trying to acheive - it may then be doable.

  18. TaseerDC
    Member
    Posted 8 years ago #

    Yes, I'm perfectly aware of what I'm doing; I'm not looking for enormous amounts of traffic, especially not from search engines (there is a method to my madness, I promise, but it'll take forever to explain). Quite simply, I don't want people to come to my site via search engines or a couple of particular referring sites; I want my blog to stay marginally private. If anyone could help me figure out what I'm doing wrong (and yes, I removed the file when it wasn't working), I'd really appreciate it.

  19. angsuman
    Member
    Posted 8 years ago #

    Try to access your site using telnet to find out exactly what is happening.

  20. paradoxdruid
    Member
    Posted 8 years ago #

    The Dreamhost Wiki has a page specifically about this phenomenon (which I was also encountering).

    http://wiki.dreamhost.com/index.php/Making_stats_accessible_with_htaccess

    I followed it, and it fixed my problems without breaking my site. Enjoy!

  21. erikcw
    Member
    Posted 7 years ago #

    Cool! That wiki entry fixed it for me too!

Topic Closed

This topic has been closed to new replies.

About this Topic