Current time: 04-20-2014, 09:09 PM Hello There, Guest! (LoginRegister)


Jump to the post that solved this thread.
Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
urgent help needed
04-15-2012, 09:45 AM
Post: #1
Not Solved urgent help needed
Hello guys
I need urgent help that I was last using .htaccess file but while i shift my hosting to windows server its not working. now please tell me what i have to do? i also want the code to redirect non www to www.
so anyone can please tell me what will I do?
thanks
with best regards
Visit this user's website Find all posts by this user
Quote this message in a reply
04-15-2012, 10:27 AM
Post: #2
Not Solved RE: urgent help needed
.htaccess is for the Apache web server. Since you're on a IIS server, you have to edit a file called web.config instead - the equivalent to .htaccess on Windows. Much like Apache needs the rewrite module, for this to work you will need the IIS Rewrite module.

If you prefer to do things manually, simply open your web.config file and add the following code to the <system.webServer> section. Make sure you replace example.com with your own domain.

Code:
<rewrite>
    <rules>
        <rule name="Force WWW" stopProcessing="true">
            <match url=".*" />
            <conditions>
                <add input="{HTTP_HOST}" pattern="^example.com$" />
            </conditions>
            <action type="Redirect" url="http://www.example.com/{R:0}" redirectType="Permanent" />
        </rule>
    </rules>
</rewrite>

Otherwise, there is a GUI in IIS to add rewrite rules which you might find easier. See the first part of this tutorial for some information:

http://weblogs.asp.net/owscott/archive/2...o-www.aspx
Find all posts by this user
Quote this message in a reply
04-15-2012, 03:34 PM
Post: #3
Not Solved RE: urgent help needed
thanks dear for the fast response. will do this right now
Visit this user's website Find all posts by this user
Quote this message in a reply
Jump to the post that solved this thread.
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | MyBB | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication