|Montana Bengal| Posted April 2, 2008 Report Share Posted April 2, 2008 Anyone comfortable with creating these? I'm trying to do a couple different things 1. Redirecting an old site to a new site 2. Preventing access to some directories on the new site. I've tried a couple different things in order to redirect, but usually I get an error saying that it isn't redirecting properly or some other error (could this be a permissions 'thing'?) On the new site, even just putting .htaccess file in the directory (blank) keeps the index page from loading. Any thoughts/suggestions? Link to comment Share on other sites More sharing options...
Jamie_B Posted April 2, 2008 Report Share Posted April 2, 2008 Never messed with appache (and havent taken that class in school yet), but if your looking to do a redirect you can use javascript on your client side and do a document.location so for instance in your html file (or file that generates the html) [code]<script language="javascript" document.location "./myotherfile.htm"; </script>[/code] or if you want to put it in a function.. [code]<script language="javascript" function myRedirect() { document.location "./myotherfile.htm"; } </script>[/code] Then call that function in your onload of your body tag (or event that javascript allows for really), like so... [code]<body onload="myRedirect()">[/code] Hope that helps, in .NET we just do response.redirect = urlwewant Link to comment Share on other sites More sharing options...
|Montana Bengal| Posted April 2, 2008 Author Report Share Posted April 2, 2008 Thanks Jamie! For some reason that didn't work so I just put this in the index.html (by itself) [code]<meta http-equiv="refresh" content="0;url=http://www.go-bengals.com" />[/code] I'm still not sure about the other. I might not be able to do what I want. Link to comment Share on other sites More sharing options...
|Elflocko| Posted April 2, 2008 Report Share Posted April 2, 2008 This site is helpful: [url="http://www.thejackol.com/htaccess-cheatsheet/"]http://www.thejackol.com/htaccess-cheatsheet/[/url] As for the blank file, it won't load the page because it doesn't know whether to allow or deny. Throw something like this in the file and start from there: [code]<Files 403.shtml> order allow,deny allow from all </Files>[/code] Link to comment Share on other sites More sharing options...
|Elflocko| Posted April 2, 2008 Report Share Posted April 2, 2008 [quote name='Jamie_B' post='647850' date='Apr 1 2008, 09:29 PM']Never messed with appache (and havent taken that class in school yet), but if your looking to do a redirect you can use javascript on your client side and do a document.location so for instance in your html file (or file that generates the html) [code]<script language="javascript" document.location "./myotherfile.htm"; </script>[/code] or if you want to put it in a function.. [code]<script language="javascript" function myRedirect() { document.location "./myotherfile.htm"; } </script>[/code] Then call that function in your onload of your body tag (or event that javascript allows for really), like so... [code]<body onload="myRedirect()">[/code] Hope that helps, in .NET we just do response.redirect = urlwewant[/quote] Pfft. Fucking programmers. Link to comment Share on other sites More sharing options...
|Montana Bengal| Posted April 2, 2008 Author Report Share Posted April 2, 2008 [quote name='Elflocko' post='647859' date='Apr 1 2008, 07:14 PM']This site is helpful: [url="http://www.thejackol.com/htaccess-cheatsheet/"]http://www.thejackol.com/htaccess-cheatsheet/[/url] As for the blank file, it won't load the page because it doesn't know whether to allow or deny. Throw something like this in the file and start from there: [code]<Files 403.shtml> order allow,deny allow from all </Files>[/code][/quote] Nice, thanks! I'd say that I have about 75% of the content transferred over to CMSMS, but now I'm starting to be contacted by other departments that are interested in setting it up (normally this would be good, but I actually scored a job today). Link to comment Share on other sites More sharing options...
|Elflocko| Posted April 2, 2008 Report Share Posted April 2, 2008 [quote name='Montana Bengal' post='647861' date='Apr 1 2008, 10:19 PM']Nice, thanks! I'd say that I have about 75% of the content transferred over to CMSMS, but now I'm starting to be contacted by other departments that are interested in setting it up (normally this would be good, but I actually scored a job today).[/quote] Congratulations! Is it the one you referred to on the board earlier? Link to comment Share on other sites More sharing options...
Jamie_B Posted April 2, 2008 Report Share Posted April 2, 2008 [quote name='Montana Bengal' post='647858' date='Apr 1 2008, 09:13 PM']Thanks Jamie! For some reason that didn't work so I just put this in the index.html (by itself) [code]<meta http-equiv="refresh" content="0;url=http://www.go-bengals.com" />[/code] I'm still not sure about the other. I might not be able to do what I want.[/quote] Odd, I typed this as a test and it worked fine. Ah well as long as you get what you need. [code]<html> <script> document.location = "http://www.yahoo.com" </script> <body> </body> </html>[/code] [quote name='Montana Bengal' post='647861' date='Apr 1 2008, 09:19 PM']Nice, thanks! I'd say that I have about 75% of the content transferred over to CMSMS, but now I'm starting to be contacted by other departments that are interested in setting it up (normally this would be good, but I actually scored a job today).[/quote] Link to comment Share on other sites More sharing options...
|Montana Bengal| Posted April 2, 2008 Author Report Share Posted April 2, 2008 [quote name='Elflocko' post='647864' date='Apr 1 2008, 07:28 PM']Congratulations! Is it the one you referred to on the board earlier?[/quote] Ummm...job or cms? CMS, yes. I have one researcher editing and creating her own pages now. She is very excited and been showing others (the reason I'm getting more questions). I'll be happy once I'm done though. I turned down the "golden handcuff" job. The new job is at The Center for Biofilm Engineering doing a range of things (mostly computer related) Basically they created a position for me that will go until the end of the summer...I worked for them last summer and they liked what I did. Pretty cool huh? I have my classes lined up for the fall and they are cool with having me for the time being. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.