Can you set ads.txt to redirect to a file on another server? - redirect

I've hit a bit of a problem with creating an ads.txt file. I'm working with an advertiser, and they would like to host the ads.txt file so they can easily make changes to it.
Is it possible to set up a redirect in at
mysite.com/ads.txt
which points to something like
theirsite.com/mysite/ads.txt
If so, what would be the code to you in mysite.com/ads.txt to make the redirect work?

For those looking, I did eventually find a solution to this by editing the following line into the .htaccess (you'll need to alter the path for your own link):
RewriteRule ^ads\.txt$ "https\:\/\/theirsite\.com\/clients\/folder\/ads\.txt" [R=301,L]

Per IAB's ads.txt Specification 1.0.1 (September 2017), section 3.1 "ACCESS METHOD",
Only a single HTTP redirect to a destination outside the original
root domain is allowed to facilitate one-hop delegation of authority
to a third party's web server domain.
So you should be fine with a single redirection from mysite.com/ads.txt >> theirsite.com/mysite/ads.txt.

It is possible with restriction. You can use redirects, as many as you want within the scope of the original root domain, which is not the fact in your situation.
For a third party domain the restriction is that only a single redirect is allowed. You should check if this is the fact for your advertisers ads.txt url.
Another possible solution is:
Crawl the advertisers ads.txt and put it in your specific folder once or twice a day.
See the specification:
https://iabtechlab.com/wp-content/uploads/2017/09/IABOpenRTB_Ads.txt_Public_Spec_V1-0-1.pdf
If the server response indicates an HTTP/HTTPS redirect (301, 302, 307 status codes), the
advertising system should follow the redirect and consume the data as authoritative for the
source of the redirect, if and only if the redirect is within scope of the original root domain as
defined above. Multiple redirects are valid as long as each redirect location remains within the
original root domain. For example an HTTP to HTTPS redirect within the same root domain is
valid.
Only a single HTTP redirect to a destination outside the original root domain is allowed to
facilitate one-hop delegation of authority to a third party's web server domain. If the third party
location returns a redirect, then the advertising system should treat the response as an error. A
future version may address other delegation of authority to a third-party web server. Any other
redirect should be interpreted as an error and ignored.

Related

Cloudflare redirect domain

I'm trying to redirect domainA.com to domainB.com. Both domains are managed with Cloudflare. I've tried using Page Rules for domainA to redirect all requests to domainB.com. However, I've also read that domainA needs to have DNS records of some sort through Cloudflare but I'm not entirely sure how to configure these? This redirect is the only thing I'm using domainA for, there's no content hosted on it at all.
A combination of a mock CNAME record and a Page Rule will make it.
Go to your source domain's DNS settings page.
Create a CNAME record for the # (root domain). Point it to some subdomain, it doesn't have to exist as the page rule will kick in before the DNS record resolves.
Go to your source domain's Page Rules page.
Create a new page rule redirecting all requests to your domain as necessary (choose 301/302 - whichever makes sense in your case).
Give it some time and confirm https://source-domain.com redirects to https://target-domain.com.
Repeat steps 1 - 5 for the www subdomain if you want www.source-domain.com to redirect too (which is often the case).
Set a forwading page rule 301 Redirect
from
http://domainA.com/*
to http://domainB.com/$1
In 6 steps you have new domain.
In your control panel, select the domain
Click on page rules
In 'url match' set example: (domainA.com/*)
Setting is 'forwarding url' with 302 (test) or 302 (production)
And finnaly set the new url ex: (http://domainB.com)
Save and deploy
for full documentation see this:
https://support.cloudflare.com/hc/en-us/articles/200172286-Configuring-URL-forwarding-or-redirects-with-Cloudflare-Page-Rules

Google Authorized redirect URIs

Let's say my app's main domain is at https://www.example.com
App is going to have lots of instances, i.e.
https://www.example.com/client1
https://www.example.com/client2
https://www.example.com/client3
<..>
In order to have OAuth2 authentication against my app, I currently have redirect URIs as such:
https://www.example.com/client1/SignInGoogle
https://www.example.com/client2/SignInGoogle
Is there a way to add one Authorized redirect URI for all of these clients? i.e.
https://www.example.com/*
or
https://www.example/com/*/SignInGoogle
Or does this URI has to be the exact match?
If you look at the Google Developer console
Must have a protocol (HTTP / HTTPS)
Cannot contain a URL Fragment (#)
Cannot contain a relative path.
Cannot be a public IP address.
Examples of Relitve vs Absolute URIs
Relative URI Absolute URI
about.html http://WebReference.com/html/about.html
tutorial1/ http://WebReference.com/html/tutorial1/
tutorial1/2.html http://WebReference.com/html/tutorial1/2.html
/ http://WebReference.com/
//www.internet.com/ http://www.internet.com/
/experts/ http://WebReference.com/experts/
../ http://WebReference.com/
../experts/ http://WebReference.com/experts/
./about.html http://WebReference.com/html/about.html
What you want to do is something like a Relative URI. What you need to remember is that an Authentication server is nothing but a web service. If you cant access the redirect URI from a normal web browser the authentication server cant either.
So no you cant do that it has to match exactly.

Can I modify a path in an Akamai redirect?

I need to create an Akamai 301 redirect rule.
I want to redirect all traffic from:
http://www.example.com/subdirectory/*
To:
http://subdomain.example.com/*
I'm able to do it easily through the control center as a "Relative Redirect Change Hostname only" - but I need the subdirectory stripped out of the target URL. I still need the rest of the path intact.
So example.com/subdirectory/file.html should redirect to subdomain.example.com/file.html.
I can get this to work in htaccess at the web server level, but I need to have it happen at Akamai.
Any suggestions?
You can use "modify outgoing request path" behavior in the configuration and select "remove part of incoming request path" for first occurrence only. This should do the trick.

301 redirect vs parking

I have several domain names registered, each a slight variant of each other.
E.g,
fastcar.com
fast-car.com
fastcar.co.uk
fast-car.co.uk
etc..
I don't wish to be penalized for duplicate content or spammy links by any of the major search engines.
Should I park them all directly on the main domain I wish to promote, 301 redirect them to the main domain or not use them at all?
If 301 redirects are the best option, would having two web hosting accounts be better than one?
Example:
Hosting account 1 has fastcar.com linked through the dns.
Hosting account 2 has fast-car.com, fastcar.co.uk, fast-car.co.uk linked through dns, and 301 redirects pointing to fastcar.com
Thanks
I'd 301 redirect and then specify your preferred URL:
http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html

IIS6 - How do I redirect users to another site for every page with a few exceptions?

I have a website setup in IIS 6, let's say it's called http://www.this.com.
I have setup a redirection for this website to http://www.that.com which maintains the directory structure and query parameters as follows:
http://www.that.com$S$Q - using the option "The exact URL entered above"
This works great, whenever someone requests, for example:
http://www.this.com/subfolder/page.aspx?Id=1
then they end up at:
http://www.that.com/subfolder/page.aspx?Id=1
Now, I have one page, actually a handler, http://www.this.com/image.axd, which I do not want to redirect.
What is the syntax for that? I've read the Redirection Using Wildcards section here, but I can't work out how to do what seems to be something straight forward.
Note that image.axd is a handler so I can't just "right click" on it and set the redirection properties as it doesn't physically exist.
I also have a couple of other pages in subfolders which I do not want to redirect, for example:
http://www.this.com/subfolder/donotredirectthispage.aspx
Any help would be appreciated.
Edit: A couple of people have mentioned using ISAPI_Rewrite, for which I'm grateful, but I really don't want to introduce another complexity into the website configuration. IIS seems to imply I can acheive what I want using the ! and 0 through 9 variables.
Is it really not possible to do this using IIS?
My current workaround is to set the redirection properties on ALL folders and pages that I want to redirect except those I do not, but this is a management nightmare.
You could implement a custom error page for the page not found error (404) that does the redirection for you. You'd turn off the redirection in IIS. Build the logic for the redirection in your custom error page. Then configure your web site so that 404 errors redirect to your error page.
If you can install software on your IIS server, I'd recommend using a tool to rewrite your request URLs.
For IIS 6.0 I've used ISAPI_Rewrite and it works really well. It's lightweight and very configurable. There's a "Lite" version available for free and will support your requirements.
You configure the program using a text file containing rules that match HTTP requests and then write actions to perform once a rule is matched. Your instance would probably require a general redirect rule (similar to the one in IIS) and rules for your exceptions.
You should look into the possibility of using a header rewrite module, for example ISAPI_rewrite. There is a free "lite" version available that is enough for your needs.
What this can do for you is the following: Before actual pages are executed on the server, the Request headers are rewritten (or HTTP 301/302 redirects are issued) based on a configurable set of rules. The underlying server sees the remaining requests as if the client really made them in that fashion.
The following rules would leave image.axd requests alone, while redirecting everything else.
# image.axd stays unchanged ("L" is the "last rule" flag)
RewriteCond Host: www.\this\.com
RewriteRule ^.*?\bimage\.axd\b.* $0 [L]
# all requests that have not been stopped by an earlier rule
# end up here ("RP" is the "permanent redirect" flag)
RewriteCond Host: www.\this\.com
RewriteRule .* http://www.that.com$0 [RP,L]