Member Avatar for Member #947415

I want to know if unclear urls will cause problems, basically for my website, I yesterday changed the url format to all lower-case (asp.net allows both upper or lower) now before the url would be something like this:
... /WebPagesSyntax <UpperCase, now the url is like this:

... /webpagessyntax < Now for this I am wondering can search engines still pick them up? Like each word, or are having underscoares better like this:

... /webpages_syntax < if I do that I would need to rename each page and somehow do a 301 redirect on all pages. I know it makes it clear for humans readers, how about search engines? Will they be bothered?

Dani AI

Generated

A concise plan that fits the thread consensus (see , ): pick one canonical format and make everything point to it with 301s. For a database-driven ASP.NET site the work splits into two problems — predictable transforms (case, underscore→hyphen) and arbitrary renames (one-off filename changes stored in the DB). Implement the predictable redirects at a global level and handle one-offs with a small lookup table.

Example: force lowercase at the IIS level (URL Rewrite) to catch accidental-cased requests:

<rule name="ForceLowercaseURLs" stopProcessing="true">
  <match url=".*[A-Z].*" />
  <conditions>
    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
  </conditions>
  <action type="Redirect" url="{ToLower:{R:0}}" redirectType="Permanent" appendQueryString="true" />
</rule>

If underscores must convert to hyphens (or both case and separator changes), a tiny application-level redirect is simpler and safer than trying to do complex string replacements in rewrite rules:

protected void Application_BeginRequest(object sender, EventArgs e)
{
    var path = Request.Url.AbsolutePath;
    var newPath = path.Replace('_', '-').ToLowerInvariant();
    if (!string.Equals(path, newPath, StringComparison.Ordinal))
    {
        var newUrl = Request.Url.Scheme + "://" + Request.Url.Authority + newPath + Request.Url.Query;
        Response.RedirectPermanent(newUrl, true);
    }
}

For non-predictable renames (records moved/renamed in the DB) keep a small Redirects table (old_slug → new_url, status) and check it early in the request pipeline; cache lookups for performance. Additional notes: update sitemaps and internal links, return true 301s (no chains), preserve query strings and protocol/host, watch for redirect loops, and monitor crawl errors (server logs / Search Console). Keeping 301s long-term avoids losing inbound-link equity.

Recommended Answers

All 7 Replies

I am not exactly sure about the effects of the underscore for SEO, but I find that using a hyphen between words is more readable.

With regard to the redirects, yes you should most definately implement this. I would suggest that you do via the URL rewrite module.

There is a great summary on the top rules that you should implement via this module on the iis.net site. I have it bookmarked and can get that for you later if needed. One of the rules mentioned in that article includes redirecting to all lowercase URLs since search engines are case sensitive on the indexing.

Member Avatar for Member #947415

Hi Jorge, I have already done the rewriting for lowercase, how can I do 301 redirect for pages which have their names changed? All the pages are stored in a databse, can I still do this from url rewrite?

Hypen is the best to use rather using the underscopheres

The hyphen is considered a space by Google and the underscore is a underscore, i.e., the hyphen separates two words and the underscore connects them. The later could affect ranking. However if you change your file names then you also need to set up a rewrite in htaccess. For more info search for a Matt Cutts video on the subject.

Use hyphen to seprate words in URL. Don't forget to do the 301 redirect your old URLs to new URLs.

Yes, I agree Hypen is more suitable to use in the URL's instead of underscores as the search engine consider the hyphens as a word seperator and also using underscore in the URL's is not appropriate for the Search engine optimization.

@criticalerror, I would start by looking at this page for information regarding URL Rewriting.

If your IIS server has the ability to leverage the URLRewrite module, you implement the rules in your web.config file.

It took me a while of reading and testing to get familiar with it, but once you understand how to implement the rules, its fairly easy to use.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.