Redirecting to another site's subfolder/path. Getting 403 Error


#1

mydomain nameservers point to Cloudflare.

I simply want to forward/redirect MyDomain.com to CompanyDomain.com/MyPage
I really do not care about what is going to show in addressbar or even SEO ranking.
The main reason I moved to Cloudflare is using its MX Record settings with my Zoho Mail.
My site is actually hosted in the company website as above and I just want my own domain address for simplicity.
I followed every single help I could find but no luck.
The best I get is below page. Any help will be very appreciated.

Server Error
## 403 - Forbidden: Access is denied.
### You do not have permission to view this directory or page using the credentials that you supplied.


#2

You could either do this on the server, however for that you actually dont even need any server as you can do this via page rules. Simply define one that redirects everything to the destination URL.


#3

Thnx, what should I put in DNS records in cloudflare? (cname, a, etc)
I already did Page URL but something should be wrong, very likely with my DNS records settings.


#4

If you are using page rules the DNS settings are actually pretty irrelevant, you just need the records themselves (assuming the proxy icon is :orange: and not :grey:). Can you post the domain in question and your page rule?


#5

Thank you or response.
I want when visitors type http://elmankar.ir/ (and also with www) in address bar, they they forwarded/redirected to http://iranjob.ir/elmankar (and also with www)
We have no concern about what is going to show in address bar or page/site SEO. As long as it gets forwarded/redirected, we are happy.
My Page Rule is as below, but currently I have no DNS RECORDS set in cloudflare. I tried everything from CNAME and A record but none of them worked.
I think my Page Rule is good but I have no idea what to add to DNS RECORDS.


#6

Thats the problem, you need to have them. Assuming you want to redirect the entire domain you can point to anywhere (you can point to 8.8.8.8 if you want). So create an A record for elmankar.ir and a CNAME for www pointing to “@” (the naked domain). Your page rule looks alright, except for the trailing plus sign, which should be an asterisk as well.


#7

Thanx for your time.
I did as you said and still no luck.

Screenshot below:


#8

WoooHoooo!
I should add $1 to the end of destination link!!


#9

Only if you want to forward whatever the wildcard matches. Do you want that?


#10

No sure what you mean (sorry I am newbie) but yeah, as long as I visitor is taken to destination website, I am Ok.

Now one problem is left.
when I enter www.elmankar.ir, (with www) it forwards to >> http://iranjob.ir/elmankar/www.
which is not a valid link. Without www everything looks good.


#11

Thats because you added $1. That should not be necessary and actually gives you the result you now have


#12

WoW, you are right. I think I rushed a bit. it seems to work! I am so excited! Thnxxxx
Would you please tell me what is the difference between + and * at the end of Page Rule url?
CloudFlare help only talks about adding +

And also diffrenece between 301 and 302 redirect?
Which one is better?


#13

The difference should be the former is not supported :slight_smile: , only the latter. Meaning + is just a plus sign, whereas * is the wildcard.

May I ask where you found that? It would be new to me + has any special meaning in this context.


#14

#15

This only talks about the plus sign as plus sign, not as wildcard. I guess because its in a Google Plus context :slight_smile:


#16

Oh thnx. I will read both articles.
One more question, please.

httpS://elmankar.ir (with or without www) does not work. Anyway I can fix it?


#17

AFAIK, Cloudflare cant issue HTTPS certificates for .ir domains right now because their CA cant issue them because some Western politicians are not happy with some Iranian politicians (meaning, sanctions :slight_smile: ) - Kindergarten on high levels :wink:


#18

I guessed so, anyway just to forward it to http without S just to prevent the error?


#19

You mean the TLS error when you try to access it via HTTPS? That you wont be able to fix because there wont be a certificate for your domain, hence you dont even get the chance to rewrite anything. For that you would need to use a non-ir domain.


#20

Thank you so very much. I helped many people in IT with patience and karma got back to me. Thank you and have a wonderful day.