1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Impossible to make a redirection on wordpress

Discussion in 'Blogging' started by powlow29, Oct 9, 2013.

  1. powlow29

    powlow29 Power Member

    Joined:
    Nov 18, 2009
    Messages:
    774
    Likes Received:
    667
    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
     
  2. dragosdydy

    dragosdydy Junior Member

    Joined:
    Jan 23, 2012
    Messages:
    116
    Likes Received:
    49
    Location:
    Italy
    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 :)
     
  3. Conor

    Conor Jr. VIP Jr. VIP

    Joined:
    Nov 7, 2012
    Messages:
    3,373
    Likes Received:
    5,437
    Gender:
    Male
    Location:
    South Africa
    Home Page:
  4. powlow29

    powlow29 Power Member

    Joined:
    Nov 18, 2009
    Messages:
    774
    Likes Received:
    667
    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.
     
  5. powlow29

    powlow29 Power Member

    Joined:
    Nov 18, 2009
    Messages:
    774
    Likes Received:
    667
    I already tried with this plugin before trying with cpanel. Same problem and not working.
     
  6. jmirko15

    jmirko15 Registered Member

    Joined:
    Jun 24, 2012
    Messages:
    85
    Likes Received:
    18
    Did you try to do this through .htaccess?
     
  7. tompots

    tompots Elite Member Premium Member

    Joined:
    Dec 11, 2011
    Messages:
    4,352
    Likes Received:
    3,955
    Gender:
    Male
    Occupation:
    Full Time Bot Developer
    Location:
    Professional Botters
    Home Page:
  8. powlow29

    powlow29 Power Member

    Joined:
    Nov 18, 2009
    Messages:
    774
    Likes Received:
    667
    Well I have no idea about what to write on my htaccess. Something with RewriteEngine I guess but I have no clue.

    I didn't. I will try now and let you know if it works.
     
  9. tompots

    tompots Elite Member Premium Member

    Joined:
    Dec 11, 2011
    Messages:
    4,352
    Likes Received:
    3,955
    Gender:
    Male
    Occupation:
    Full Time Bot Developer
    Location:
    Professional Botters
    Home Page:
    try pretty link lite first before you go buying the pro version, also I believe you would have to have it installed on http://whatever.mydomain.com for it to do what you need

    Code:
    http://wordpress.org/plugins/pretty-link/
    
     
    Last edited: Oct 9, 2013
  10. jmirko15

    jmirko15 Registered Member

    Joined:
    Jun 24, 2012
    Messages:
    85
    Likes Received:
    18
    Pretty straight forward tbh
     
  11. powlow29

    powlow29 Power Member

    Joined:
    Nov 18, 2009
    Messages:
    774
    Likes Received:
    667
    OK, I tried and it's not working.
     
  12. jmirko15

    jmirko15 Registered Member

    Joined:
    Jun 24, 2012
    Messages:
    85
    Likes Received:
    18
    PM me your Skype mate.
     
  13. fistor

    fistor Regular Member

    Joined:
    Feb 29, 2012
    Messages:
    256
    Likes Received:
    315
    Location:
    A mind needs books as a sword needs a whetstone, i
    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.
     
    • Thanks Thanks x 1
  14. powlow29

    powlow29 Power Member

    Joined:
    Nov 18, 2009
    Messages:
    774
    Likes Received:
    667
    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.
     
  15. fistor

    fistor Regular Member

    Joined:
    Feb 29, 2012
    Messages:
    256
    Likes Received:
    315
    Location:
    A mind needs books as a sword needs a whetstone, i
    Then create a Folder. :)
     
  16. powlow29

    powlow29 Power Member

    Joined:
    Nov 18, 2009
    Messages:
    774
    Likes Received:
    667
    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.
     
  17. jmirko15

    jmirko15 Registered Member

    Joined:
    Jun 24, 2012
    Messages:
    85
    Likes Received:
    18
    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/
     
    • Thanks Thanks x 1
  18. powlow29

    powlow29 Power Member

    Joined:
    Nov 18, 2009
    Messages:
    774
    Likes Received:
    667
    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
     
  19. powlow29

    powlow29 Power Member

    Joined:
    Nov 18, 2009
    Messages:
    774
    Likes Received:
    667
    Ok, I got this solved thanks to jmirko15

    Thanks all for your help :)
    If someone have the same problem just put this at the end of your .htaccess :

    Redirect /ababab/ http://ababab.yoursite.com/
     
    • Thanks Thanks x 1