Click here to Skip to main content
15,886,570 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have added URL rewriting rule in ASP.NET application(nopcommerce 1.6). Rule is "Domain name/product-code" will redirect to actual product ie "domain name/product.aspx". Its completely working fine in local machine but when i am deploying it on live server it shows 404 error. Please help me friends.
Posted
Comments
Afzaal Ahmad Zeeshan 12-Feb-15 13:08pm    
Is that page (or all other required pages) available?
Member 10489937 13-Feb-15 6:18am    
"Domain name/product-code" means i want user to enter "domain/xxx" ,here xxx is code of product.And On entering it should redirect to "domain name/product.aspx" . Here product.aspx has product having code "xxx" . There is no page "domain/xxx"

Please check if there is any Image you have placed on your page, because that image is also required complete path, in that case also you will get 404 error.
 
Share this answer
 
Comments
Member 10489937 13-Feb-15 6:59am    
You are right i am getting 404 error . But i want to redirect to product when user enters "domain/xxx". Its working in local but when i deploy it at live server its shows 404. Do i need to make setting in IIS???
I got solution. I added
<rewrite>
            <rules>
                <rule name="rullll">
                    <match url="^p/([a-z0-9/]+)$" />
                    <action type="Rewrite" url="page.aspx?productcode={R:1}" />
                </rule>
            </rules>
        </rewrite> 


to web.config
And have done some stuff of coding in page.aspx. (I got product code from query string and then redirected to respective aspx page of that product)
Here i have made a compromise. User needs to enter url line domainname/p/product-code
instead of domainname/product-code
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900