Submit Your Article Forum Rules

Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: .htaccess file type for .asp

  1. #1
    Senior Member ldylion214's Avatar
    Join Date
    Mar 2004
    Location
    Tucson, AZ
    Posts
    289

    .htaccess file type for .asp

    I've been told a .htaccess file won't work on my site because it is .asp. What would be an alternative that would work for me. I have an old javascript code for redirect Would something like this work to redirect my //tribeazure.com to //www.tribeazure?

  2. #2
    Senior Member ldylion214's Avatar
    Join Date
    Mar 2004
    Location
    Tucson, AZ
    Posts
    289

    Re: .htaccess file type for .asp

    Would either of these work?

    ASP Redirect
    <%@ Language=VBScript %>
    <%
    Response.Status="301 Moved Permanently";
    Response.AddHeader("Location","http://www.new-url.com/");
    %>


    ASP .NET Redirect
    <script runat="server">
    private void Page_Load(object sender, System.EventArgs e)
    {
    Response.Status = "301 Moved Permanently";
    Response.AddHeader("Location","http://www.new-url.com");
    }
    </script>

    I'm trying to find this on my own. I think I'll post this is the database section.

  3. #3
    WebProWorld MVP incrediblehelp's Avatar
    Join Date
    Jan 2004
    Posts
    7,567

    Re: .htaccess file type for .asp

    Nicci have you tested either of them on your website? I think that would be the best way to find out .

    Here is more 301 redirection help

  4. #4
    Senior Member ldylion214's Avatar
    Join Date
    Mar 2004
    Location
    Tucson, AZ
    Posts
    289

    Re: .htaccess file type for .asp

    Hey I recognize that green face! Yes I will test them out as you suggested. I guess the worse can happen is I have to take the code out.
    Thanks for the help and the link!
    Best, Nicci

    PS. Question. Where on the page does this code go?

  5. #5
    Senior Member ldylion214's Avatar
    Join Date
    Mar 2004
    Location
    Tucson, AZ
    Posts
    289

    Re: .htaccess file type for .asp

    Quote Originally Posted by incrediblehelp View Post
    Nicci have you tested either of them on your website? I think that would be the best way to find out .

    Here is more 301 redirection help

    I've tested more than a few codes on my site. Here are the two my host recommends:

    <%@ Language=VBScript %>
    <%
    Response.Status="301 Moved Permanently";
    Response.AddHeader("Location","http://www.tribeazure.com/");
    %>

    <script runat="server">
    private void Page_Load(object sender, System.EventArgs e)
    {
    Response.Status = "301 Moved Permanently";
    Response.AddHeader("Location","http://www.tribeazure.com");
    }
    </script>

    Can anyone see anything I may have done wrong? I placed them at the top of the page. I get a 500 Internal Error. Grrr.

    Thanks! Nicci

  6. #6
    WebProWorld MVP incrediblehelp's Avatar
    Join Date
    Jan 2004
    Posts
    7,567

    Re: .htaccess file type for .asp

    Have you asked your host for support on this issue?

  7. #7
    Senior Member ldylion214's Avatar
    Join Date
    Mar 2004
    Location
    Tucson, AZ
    Posts
    289

    Re: .htaccess file type for .asp

    Quote Originally Posted by incrediblehelp View Post
    Have you asked your host for support on this issue?
    Yes, they only said do a 301 Header Redirect. The above code is what I found listed on their site. From what I'm reading an IISrewrite keeps coming up. I'm in over my head with this stuff.

  8. #8
    WebProWorld MVP incrediblehelp's Avatar
    Join Date
    Jan 2004
    Posts
    7,567

    Re: .htaccess file type for .asp

    Nicci I dont see the redirect code anywhere on the home page.

  9. #9
    Senior Member ldylion214's Avatar
    Join Date
    Mar 2004
    Location
    Tucson, AZ
    Posts
    289

    Re: .htaccess file type for .asp

    Quote Originally Posted by incrediblehelp View Post
    Nicci I dont see the redirect code anywhere on the home page.
    I took if off because it was causing the 500 error. Dubbya suggested I contact the host and tell them to configure under IIS where both URLs resolve to the same domain. I sent them a message. I should hear back within 24 hours.
    Do you see what I may have done wrong in the code?
    Thanks!

    Best, Nicci

  10. #10
    Junior Member
    Join Date
    May 2007
    Posts
    21

    Re: .htaccess file type for .asp

    Quote Originally Posted by ldylion214 View Post
    Do you see what I may have done wrong in the code?
    it looks like you are in a loop that redirects regardless of the domain name. you might want to try something like the script below:

    Code:
    <%@ Language=VBScript %>
    <%
    If Request.ServerVariables("SERVER_NAME") <> "www.tribeazure.com" Then
    	Response.Status="301 Moved Permanently"
    	Response.AddHeader("Location","http://www.tribeazure.com/") 
    End If 
    %>
    it should skip the redirect if the SERVER_NAME is Native American Jewelry - American Indian Jewelry
    Have a nice day

Page 1 of 3 123 LastLast

Similar Threads

  1. dot htaccess file
    By caneman in forum Webmaster Resources Discussion Forum
    Replies: 3
    Last Post: 02-18-2010, 08:39 PM
  2. .htaccess file type for .asp
    By ldylion214 in forum Web Programming Discussion Forum
    Replies: 5
    Last Post: 11-19-2007, 07:51 PM
  3. help regarding .htaccess file
    By SES Trims in forum Search Engine Optimization Forum
    Replies: 1
    Last Post: 12-26-2006, 07:48 PM
  4. help regarding .htaccess file
    By SES Trims in forum Google Discussion Forum
    Replies: 3
    Last Post: 12-08-2006, 05:59 PM
  5. .htaccess file creation help... please
    By WebCraft in forum Web Programming Discussion Forum
    Replies: 3
    Last Post: 10-28-2003, 08:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •