301 redirect with page rules not working

Hi, this is my second time posting this.

I’m trying to redirect my domain to a separate domain inner page. I’ve reset all my host settings and even moved to a new host but it’s still not working. Any ideas? Please let me know.

See the


screenshot below.

Still fails when you add a wildcard infront?
eg *thespir.it/*

Keep only A records and remove rest and try

Did you follow the directions from the Marked Solution in your other post?

Yes, I did. Didnt help.

Just to confirm only keep A record to thespir.it and delete the rest?

Just tried that and still nothing. I can give it a little bit.

I wouldn’t mess with your DNS records here…much.

mail should be :grey: DNS Only
ftp should be :grey: DNS Only

That’s because Cloudflare doesn’t proxy mail or FTP. But that doesn’t have anything to do with a Redirect for your website.

Considering you have the correct name servers, all evidence points to a previous integration interfering with your :orange: records.

Would you happen to still have hosting for your spirit website? You might be able to toggle that DNS record to :grey: DNS Only and handle the redirect at your host.

Otherwise, you’ll have to open a ticket here and see if Cloudflare can clear up whatever integration is interfering with your :orange: record(s).

Ok that makes sense, yes I still have hosting for the spirit. Are you saying I should turn off the poxy in cloudlfare and try that? If not then do the redirect through the host?

Yes. If it’s :grey: DNS Only, your old :orange: Proxied setup won’t interfere.

Alright thanks, I just gave it a try.

1 Like

It’s still not working. Do you know any other options for redirects that has the options like page rules?

My host is not letting me do the setup I want.

Are you sure your hostnames are set to :grey: DNS Only? They’re still resolving to Cloudflare IP addresses.

Create a .htaccess file in thespir.it root folder, and put this code in that file:

RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(www\.)?thespir\.it$ [NC]
RewriteRule ^(.*)$ https://yournewurlhere.com/folder/ [L,R=301]

Something like this
image

1 Like

I tried it with both proxys on and off.

Great thanks! Is there a way I can test this code before rolling it out on the site?

Also, this will direct all pages under thespir.it to https://liquorlaboratoryDOTcom/cocktail-recipes/

For example:

thespir.it/tequila-escape-plan/
thespir.it/american-rums/

Will both point to https://liquorlaboratoryDOTcom/cocktail-recipes/

After that?

As i know, you are using bluehost so i guess it’s cpanel hosting.
That snippet should work because it’s working on my server. That snippet should work on any hosting base on Apache.

Yes, it is. If you want to redirect but keep path and query, just make a little change to that snippet

RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(www\.)?thespir\.it$ [NC]
RewriteRule ^(.*)$ https://yournewurlhere.com/$1 [L,R=301]

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.