Cloudflare page rules using wildcard redirect - redirect

I wanted to redirect all old blog URLs to the new ones.
www.mysite.com/blog/anything-here should redirect to www.mysite.com/anything-here.
Basically, all URLs that have "blog/" should be redirected to the new URL which is without the "blog/"
I have tried it on Cloudflare page rule by using
mysite.com/blog/* to mysite.com/$1
It is working fine but if you visit mysite.com/blog only it redirects to mysite.com which it shouldn't be happening.
How should i set my redirect pagerule?

Related

Redirect Domain to Subdomain using Cloudflare

I'm using a marketing automation platform to build landing pages and those landing pages URLS are automatically published with a subdomain structure, like:
https://subdomain.example.com/mylandingpage
I want to redirect all www and non www visits to the main domain to this landing page that I created, in other words I wish the https://example.com and https://www.example.comto be redirected to https://subdomain.example.com/mylandingpage
Since I'm only using this platform and did not subscribe to any hosting, I'm trying to use Cloudflare to make all this redirects.
I saw a tutorial and this guy said that A entries in my DNS shouldn't be blank and recommended setting them to a reserved IP address, so I set both A entries to 192.0.2.0.
Ok, then I went to page rules and set a 301 redirect to *example.com to be redirected to https://subdomain.example.com/mylandingpage
I can see that when I visit my main domain it's redirected to the subdomain correctly, but the page doesn't load, and I get a too many redirections error. I believe that I made something wrong and it's redirecting everything to the subdomain, even the subdomain is redirecting to itself, even having a page path /mylandingpage after the hostname.
Did I make myself clear? Is there any other way to do what I want?
In Cloudflare page rules instead of *.example.com, please use exact domain match.
URL path we can use wildcard.
www.example.com/* - https://subdomain.example.com/mylandingpage
example.com/* - https://subdomain.example.com/mylandingpage

.htaccess 301 redirect with trailing ? in URL

any assistance on this redirect question is appreciated. I am adding several redirects from an old url to new pages on a website. Several of the old urls that are indexed have a trailing ? in the url. www.example.com/products/1234?
I have the following redirect in place that does not work
Redirect 301 /products/1234? http://www.example.com/test/
If I remove the question mark above the redirect does work, however it then adds in a question mark to the url it's redirecting to. http://www.example.com/test/?
How do I get this to redirect without it displaying a ? in the URL?

How can I redirect a page to an external url AEM6.1

I need to redirect an AEM page to an external URL. For eg., I have a page /content/test, and I have to redirect it to http://www.google.com/. How can I do that?
Basically, when someone hits that page, it should get redirected to http://www.google.com/
Can I use vanity URLs for this?
If you are extending from the foundation page component, you can specify the redirect in the Advanced tab of the page properties. This would behave similar to a 301 redirect.
Another way of doing the same would be do define /etc/map configurations.
However, I would prefer having the redirect configured in the Web Server (Apache vhost file) or CDN itself (if there is one) so that the request doesn't reach AEM servers.

How can I redirect a request to a subdomain to another subdomain on Route 53?

I have a GitHub Pages Jekyll blog at blog.Antrikshy.com. I have been meaning to move it to code.Antrikshy.com for a while now. I made the new address a CNAME for antrikshy.github.io on Amazon and wired everything correctly to make it work. Now my blog.Antrikshy.com URL is broken. How can I set it to redirect it to the new subdomain?
I'm new to this. Comment if you want any more information.
Preferably I'd like to do a 301 redirect and also retain the entire path, but that's not very important. I just want it to work, even if it means that users are redirected to the new home page.
You could accomplish this with s3 website redirect[1].
create a new s3 bucket with the name blog.antrikshy.com
enable s3 website
create an alias to blog.antrikshy.com bucket
enable redirects on your website
you can create redirects per page as well by creating a key for each page or redirect everything to your homepage
http://aws.amazon.com/about-aws/whats-new/2012/10/04/web-page-redirects-on-amazon-s3-hosted-websites/

I want to redirect the index.php from a Wordpress site to another URL, and all the other URLs in the WP site separatley

So, here is the problem:
I need to have a redirect from website.ro/ to website.com/
Website.ro is on wordpress.
At the same time, all the sub-links like website.ro/title will be redirected individually to website.com/different_title_same_content
If i do this:
Redirect 301 /index.php http://website.com/
Redirect 301 /title http://website.com/different_title_same_content
What happens is that website.ro is on wordpress, that means that all the sublinks are called through index.php (i think, but not sure) and if i do a redirect on index.php than all the other links will be redirected to the homepage and not to their corresponding innerpage.
Its like setting a master rule when i'm redirecting the index.php.
What i would like to do is redirect index.php to a homepage, and any other variation on its corresponding subpage on the new website.
Can it be done?
EDIT: I have added a little of the code that i have to write:
Redirect 301 /Zuzu newsite/portfolio/cases/doc/47860743/
Redirect 301 /Antena1 newsite/portfolio/cases/doc/47860862/
...and so on for allmost 100 urls. (i had to post here without http and www since i am not allowed here more than 2 urls)
The reason i have to do this is that in the past, many of the links on the oldsite appeared in articles, press, blogs and so on, and i do not want to loose traffic that the old links generated on each page.
At the same time, i want to redirect the homepage to the newsite homepage, but if i do this with:
Redirect 301 / newsite/
it will redirect all the other links to the main page of the newsite and not to its corresponding article.
Its the same if i do Redirect 301 /index.php newsite/
since the old website is on wordpress and i think that all the pages are called through index.php(and some variables)
Also, the urls on the newsite.com are not rewritable as to rename them as the old ones so i can create an automated redirect generally valid.
WHAT IS THERE TO DO?
Look into this it may solve your issue
http://enarion.net/web/htaccess/migrate-domains/
Best of luck!