How to identify a redirected domain? - url

Is it possible to identify a redirected domain?
I have 3 domain> www.example1.com , www.example2.com , www.example3.com
www.example2.com domain redirected to www.example1.com
www.example3.com domain also redirected to www.example1.com
How to identify the redirected url is example2 or example3?

I have added redirected url with query string at the end of the url and display popup based on query string value.

Related

How to redirect URL with slash after domain url

I bought a domain on namecheap. I want to redirect that domain url to another url but, I don't want to redirect for example google.com > youtube.com . I want to redirect it with this slash after domain url like google.com/hello > youtube.com .. I can only redirect for example hello.google.com > youtube.com but not google.com/hello > youtube.com .. why I can't do that?

Which url is the correct to show 404 to robots?

Which url is the correct to show 404 to robots?
http://domainname.com/404pagenotfound.php
Page contains 404 content
(or)
http://domainname.com/lldfgjldfjg.php
Page contains 404 content
I.e Do I want to redirect the mismatched url to 404pagenotfound.php
OR
Do I want to show page not found in the same mismatched url.
user has to have a possibility how to edit the URL (eg. when they only mistype).
So, URL http://domainname.com/lldfgjldfjg.php with 404 status code for search engines and 404 text message for user is the ideal way.

SEO: index linked-to page but do not index URL

In one of my ASP.NET MVC application I'm using an actionlink to switch the language, e.g. http://example.com/nl/home/switch?lang=en&redirect=/en/home/about. When the url is pressed, the switch function redirects the user to /en/home/about with language en (English). The problem is Google is indexing the switch actionlink as if it is the linke-to page. So in this example /en/home/about shows up in the Google results as http://example.com/nl/home/switch?lang=en&redirect=/en/home/about instead of http://example.com/en/home/about. I think rel="nofollow" is not an option since the linked-to page will be ignored. Also, in the actionresult I'm using the function Redirect(..);, correct me if I'm wrong, but doesn't the Redirect function sends header 302? Any suggestions to solve this?
Google doesn't deal well with 302 redirects. A 302 redirect is a "temporary" redirect. When you issue a 302, Google may prefer to index the redirect itself because you are saying that the item that it is pointing to may change. If you changed your redirect code to issue a 301 permanent redirect, I believe that Google would behave as you desire.

named route's URL in Rails

HI,
I have a problem printing the named route's URL in production application. In one of my email template (email registration confirmation), am trying to append the confirmation url. this is the template snippet
<p>Welcome to example. To complete your registration, please click on the link below or paste it into a browser to confirm your e-mail address. You will then be redirected to example.com login page </p>
<p> <%= confirmlogin_url(:id => #user.id, :msg => #user.verification_code )%> </p>
and my named route looks like this
match 'confirm_registration' => 'users#confirm_user' ,:as=> :confirmlogin
It works fine in the development environment, and the email is rendered with the confirmation url like this
Welcome to example. To complete your
registration, please click on the link
below or paste it into a browser to
confirm your e-mail address. You will
then be redirected to example.com.
http://localhost:3000/confirm_registration?id=16&msg=7fe548db-ab7d-3a8d-a87f-94ba89b0c29b
But in production environment i expected localhost:3000 be replaced with my actual domain name. But it still prints the local host url..
I just wanted to confirm this is the expected behavior..?
Put this onto your production.rb
ActionMailer::Base.default_url_options[:host] = "0.0.0.0:3000"
Use your hostname.

JSF login forward address bar / url -- redirect does not solve problem

Okay we have a single - sign - on and the user will likely enter www.blabla.com/AppName/ to reach our site. We then define a welcome site, use a phaselistener to check:
is user trying to access the welcome site? yes -> try to login - works? yes -> get user roles -> forward to the appropriate site for this specific user.
E.g. user niceBelly goes to page /somewhere/in/many/folders/beer.jsf and user barbie goes to /breasts/pink.jsf
a redirect is in this application not possible for some reasons.
the result is that when reaching e.g. page pink.jsf the address bar still shows blablaba.com/AppName/
clicking the first link will result in the browser using the form address as new URL e.g. on welcome.jsf i navigate to coolstuff.jsf. On the page coolstuff i now have the url of the last form, e.g. welcome.jsf. Then on cool stuff i click a link, and get coolstuff on the next page as url, and so on.
Is there a way to solve this / work around it?
Given the symptoms, you are actually not redirecting the requests, but you are actually forwarding the requests. A real redirect will take place when you call
externalContext.redirect(url);
in JSF context, or when you add
<redirect />
to the navigation case. All other ways are effectively forwards. As per the symptoms, you're using commandlinks instead of outputlinks to navigate to other page. Commandlinks will submit a POST request to current URL and JSF will under the covers use RequestDispatcher to set the destination of the request/response when the navigation case doesn't contain <redirect />. A forward does not instruct the browser to fire a new GET request on the destination URL and hence the URL in browser address bar does not change. A real redirect will do exactly that.
See also:
When should I use outputlink instead of commandlink?
Bookmarkable URLs in JSF 1.x

Resources