I am not sure my question makes sense. I have read everything I could on the subject but it did not answered my interrogation.
So here it is: I know search engines do not consider temporary redirects, with 302 status.
They do not pass any link juice in redirecting one page to another.
This is not the case for 301 status redirects.
Grails default all its redirects to 302 status.
My question is:
Does that affect SEO in any bad way, or not at all ?
I am speaking about controllers' redirects here, when handling action calls. As it is not the change of one page location to another, but just the way users move into the application, should I care about what kind of redirect is issued by my controllers actions ?
Any bit of explanation is most welcome.
Normally redirects (302) are used in response to some user input, for example a user post a form and the controller redirect to a different page based on form input.
If this is your scenario you have not to worry about SEO, search engine never compile forms.
But if you use grails controller redirect as a default navigation system for your app this is wrong. In the web every page may have a unique uri so a search engine can find it.
It doesn't affect the search engine rankings, if you properly include canonical tag and set up preferred domain in Google webmaster tools
Related
I am currently working with localizing my MVC4 web application and have run in to an issue. My site is in four languages, English, French, Russian and Polish. I set up the sites culture based upon what the user selects. This is not tracked in the url.
I want my urls to be SEO friendly. So I need them to be localized. The tricky part though is that fact I routes set up for my controllers in English. For example
/product/product-name is mapped to the product controller and the get action
/customer/details is mapped to the customer controller and the details action
How can I localize the routes to different languages/cultures? So when I create an action link it maps to correct controller/action, generating the localized url?
I found this solution and it is very elegant but the issue I have is that it does not work as well for dynamic url's, as there is a need for explicit mapping.
Actually I don't know the right answer for that question and it's really very interesting how it possible to do that with standard MVC routing.
But if you do not find proper way to implement that with standard options you could implementing that by hands with the helps of front controler.
You create the class which will be main point of availability inside your app. And inside that method you could implement redirecting logic which will redirect you to the proper controller/action.
I am loading a form onto a page via ajax in my Rails 3.2 app. These views are being picked up by Google and the urls just render blank pages. Should I somehow prevent access to these pages when attempting to view from outside my app (http referrer or something like that) or just use the robots.txt file?
Therefore my question is: What is the best thing to do when you have a view which is only ever loaded in via ajax. This is a programming question, as I am happy to code in whatever best practices to my controller files etc. However, it is also from the perspective of SEO and the performance of my app.
I don't want Google to index these pages - however - I don't know if preventing access directly is the best option (such as in this question: How deny access direct URL to my partial views? <- wrong environment, or this one https://stackoverflow.com/questions/11522307/prevent-direct-access-to-certain-urls-only-rails-app-can-load-them <- related but unanswered.)
Of course, I could define these pages in my robots.txt and stop them being indexed, however, maybe there is a better solution.
If you don't want Google to index any of your apps pages for what ever reason Ajax or not I suggest simply using a robots.txt file to Google not to index them.
I'm not aware of a way to block specific partials, Only whole pages.
This would be considered an SEO best practice.
Is there any reason you felt this may not have been the solution? UX? Google TOS?
so I just migrated a bunch of my old web sites to .net mvc and turned them loose on the net last week.
I optimized them as best I know how for SEO but I'm noticing that NONE (not a single one!) of my sub pages is being displayed on google...only my home pages.
I created controllers for the products to try and give them plugs for each page.
ex:
http://www.mywidgets.com/widget_to_make_coffee/coffee_making_widgets
ironically, google is still showing some of my sub-pages from the old site, which I have redirecting to the new, but I fear that when it fully updates its index, I will lose that placement and not gain the placement from my new stuff as it's no-where to be found...
is this bad practice? Should I have structured everything off of the home controller?
Should I have structured everything off of the home controller?
No. Something else it's going on.
One of the advantages of ASP.NET MVC is that you can de-couple your routes (URLs) from the logic of your code (models/views/controllers)
The only important thing is that you have something at the old urls passing a 301 redirect to the new urls. Google will fix itself pretty quickly after that.
Depending on how many incoming links you've got, you might end up keeping the redirector up permanently.
I'm looking for a best practice suggestion.
I've got a ShoppingBag Controller with a Partial that lists all the items in the user's bag. In this Partial you can remove items from the bag via a form post.
The Partial has been place in a Master Page which is referenced by each of the Views in the Controller. When an item is removed from the user's bag, I'd like the user to be redirected to the originating View. I'm quite happy with how I would achieve this with JavaScript, it is the non JavaScript I am not clear about.
Do I:
Detect the referring Action using Request.UrlReferrer and redirect. This could be quite laborious detecting the Action/Route from a URL.
Pass a hidden field with the Post. Not really keen on the thought of bloating the HTML.
Don't redirect to originator, redirect to a confirmation page. Would prefer to avoid if possible.
Something I've missed.
Any helped would be appreciated.
Rich
Definitely #2. It's not bloat, it's expressing your intent. It'll be 50 bytes, don't sweat it, you should be gzip'ing your HTTP anyway.
However, do make sure that you secure it such that someone can't put any old page in there, or another site. Perhaps use an enum value if the number of originating views is constrained.
I have a website where my present "geeky" urls look like:
http://www.bestatdubaiholidays.co.uk/pages/Quote/Details.aspx?GUID=01a25b0c-e0ac-40ba-abd1-298f3abd9612
I want to change these to Search Engine Friendly ones - something like:
http://www.bestatdubaiholidays.co.uk/the-palm-atlantis.aspx
or
http://www.bestatdubaiholidays.co.uk/the-palm-atlantis
I have hundreds of incoming links (from ad campaigns and other sites) to my geeky urls that I want to retain.
So if someone types a geeky url, I want the address bar to show the equivalent search engine friendly url.
Can anyone help? Referring to other articles won't help. Believe me, I've read every one of them. Any example urls will be helpful.
Use something like this http://blog.eworldui.net/post/2008/04/ASPNET-MVC---Legacy-Url-Routing.aspx
You don't have to use MVC, the routing classes are standalone now
I suggest using a Front controller. This means that you use the rewrite engine of whatever httpd server you're using to redirect ALL requests to a single file (index.php or index.aspx or whathaveyou) and then you use code in that file to dispatch to the appropriate page. You can do a redirect from the geeky URLs to the friendly URLs, and if it's a friendly url then you load the appropriate page.
This would be way easier than writing huge rewrite rules for each type of page you might have. And this way all of the work is done in the same language your site is already running, so you don't have to learn and maintain a new file that is in its own language just for the redirection.