Impossible to make a redirection on wordpress

powlow29

Supreme Member
Joined
Nov 18, 2009
Messages
1,352
Reaction score
1,149
Hi,

Here is my problem. I have a post on my wordpress site : http://www.mydomain.com/whatever and I was trying to redirect this post using the redirection plugin to http://whatever.mydomain.com but for some reasons, it's not working and I don't understand why. First time it's happening to me.

Here is what my cpanel tells me when i'm trying to make the redirection on Cpanel :
Code:
You cannot redirect "whatever" to "http://whatever.mydomain.com" as this  will cause a redirection loop because  "/home/user/public_html/whatever/" is the document root of one of  your domains.

I have found several solutions on google. Working for some people and not working for others so before trying, I'm asking you, do you have a simple working solution for that ? Because I will need to do this kind of redirections a lot of times.

Awaiting for your replies,

Thanks guys

Powlow29
 
Did you created the subdomain?
Also create another wildcard subdomain named: *.mydomain.com - this will accept all kinds of combinations for subdomain...just my opinion :)
 
Yes the subdomain is created already and a I made a website on it, fully working.
I don't get what you are trying to say about *.mydomain.com, I don't see how this wildcard subdomain will help me.
 
Have you tried pretty link pro? this is what I use.
 
Did you try to do this through .htaccess?
Well I have no idea about what to write on my htaccess. Something with RewriteEngine I guess but I have no clue.

Have you tried pretty link pro? this is what I use.

I didn't. I will try now and let you know if it works.
 
Please do not install plugins because you fear 3 lines of codes. Every plugin is a potential security hole, and slows down your site.

.htaccess:

RedirectMatch 301
http://www.mydomain.com/whatever(.*)
http://whatever.mydomain.com/$1

Put that .htaccess into the "http://www.mydomain.com/whatever"-Folder.

Other than that, your config seems to be messed up. cpanel refused to do the task for good reasons I assume.
 
Please do not install plugins because you fear 3 lines of codes. Every plugin is a potential security hole, and slows down your site.

.htaccess:

RedirectMatch 301
http://www.mydomain.com/whatever(.*)
http://whatever.mydomain.com/$1

Put that .htaccess into the "http://www.mydomain.com/whatever"-Folder.

Other than that, your config seems to be messed up. cpanel refused to do the task for good reasons I assume.

http://www.mydomain.com/whatever is the link of a post on my wordpress website. There is no folder for "whatever" because it's a post like this for example
Code:
http://www.zeros-sociaux.fr/2013/08/signaux-contraires/
So your redirection is not working.
 
I will explain this again :) I have a domain mydomain.com, on this domain I have a post named post1 I made a subdomain named post1.mydomain.com I want that when someone click on my post named post1 the visitor will be redirected to my subdomain post1.mydomain.com Bot domain and subdomain are using Wordpress.
 
http://www.mydomain.com/whatever is the link of a post on my wordpress website. There is no folder for "whatever" because it's a post like this for example
Code:
http://www.zeros-sociaux.fr/2013/08/signaux-contraires/
So your redirection is not working.

No Skype oh well :P


Name of the file: .htaccess (probably already got one under public_html root folder of wordpress)
If you don't then place it on root folder of wordpress, so on yourdomain.com/

Add the following bottom lines:

RedirectMatch 301
http://www.yoursite.com/2013/08/asdasd/
http://asdasd.yoursite.com/
 
No Skype oh well :P


Name of the file: .htaccess (probably already got one under public_html root folder of wordpress)
If you don't then place it on root folder of wordpress, so on yourdomain.com/

Add the following bottom lines:

RedirectMatch 301
http://www.yoursite.com/2013/08/asdasd/
http://asdasd.yoursite.com/

I tried with putting this redirection at the end of my .htaccess on the root folder of wordress and got a "Internal Server Error" lol
Will send you a pm
 
Back
Top