Hire is one more problem with redirect:
when the user or bot open the URL like this https://www.test.com/category-name-C8.aspx (with https) or http://test.com/category-name-C8.aspx (without www) this 2 links redirecting to http://www.test.com/Category.aspx?CategoryId=8 - that is wrong - that 2 URLs mus be going to http://www.test.com/category-name-C8.aspx
And the same with product detail URL too:
Open this https://www.test.com/Product-name-P7938.aspx (with https) or http://test.com/Product-name-P7938.aspx (without www) - redirecting to http://www.test.com/Product.aspx?ProductId=7938 - that is wrong too!!
Must going to http://www.test.com/Product-name-P7938.aspx
Help me to fix it.
Thanks,
Alex
One more URL redirect problem
Re: One more URL redirect problem
You can try using canonical link for search engine. In order to do so edit you website/yourcategorypage.aspx file and then update its load method as below
Code: Select all
protected void Page_Load(object sender, EventArgs e)
{
if (_Category != null) PageHelper.BindMetaTags(this, _Category);
StringBuilder htmlHead = new StringBuilder();
string url = Token.Instance.Store.StoreUrl;
if (!url.EndsWith("/"))
url = "/";
string catUrl = _Category.NavigateUrl;
if(catUrl.StartsWith("~"))
catUrl = catUrl.Remove(0,1);
if(catUrl.StartsWith("/"))
catUrl = catUrl.Remove(0,1);
url = url + catUrl;
string canonicalFormat = "<link rel=\"canonical\" href=\"{0}\" />";
htmlHead.Append(string.Format(canonicalFormat, url));
Page.Header.Controls.Add(new LiteralControl(htmlHead.ToString()));
}
- AlexG
- Commander (CMDR)
- Posts: 128
- Joined: Mon Mar 03, 2008 9:51 pm
- Location: StealDeals.com
- Contact:
Re: One more URL redirect problem
Thanks for help - I've added that code but NO result - I fetch that page as google and get the same error - URL with paramets.
PLEASE HELP ME TO FIX IT
Thanks,
Alex
PLEASE HELP ME TO FIX IT
Thanks,
Alex