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

[Help] How to redirect few pages in wordpress?

Discussion in 'Web Hosting' started by bojana, Apr 7, 2013.

  1. bojana

    bojana Junior Member

    Joined:
    Jan 28, 2010
    Messages:
    185
    Likes Received:
    157
    Location:
    Europe
    Hi,

    im gonna change wordpress theme on one of my website and this will change all the links.

    Does anyone know what would be the best/fastest way to redirect around 100 pages from:
    domain.com/portfolio/123 to domain.com/123 (name without portfolio)

    Thanks,
    Julija
     
  2. wankerpanther

    wankerpanther Registered Member

    Joined:
    Aug 29, 2011
    Messages:
    64
    Likes Received:
    9
    I don't really get what you mean but I guess you want to change the category of the articles, if yes then just select all and change the category or if you mean changing the folder in which wp is installed in then do MySql backup and restore.

    Hope that helps
     
    • Thanks Thanks x 1
  3. harshaaliaschinna

    harshaaliaschinna Regular Member

    Joined:
    Feb 19, 2013
    Messages:
    260
    Likes Received:
    119
    Location:
    india
    Home Page:
    • Thanks Thanks x 1
  4. MarthaJos

    MarthaJos BANNED BANNED

    Joined:
    Jul 6, 2012
    Messages:
    42
    Likes Received:
    10
    if this "portfolio" is a category then you can go to permalinks and change the URL structure (remove category) : %category%

    it will be solved with this.
     
    • Thanks Thanks x 1
  5. bojana

    bojana Junior Member

    Joined:
    Jan 28, 2010
    Messages:
    185
    Likes Received:
    157
    Location:
    Europe
    I found the solution for this by using this rule in my .htaccess file:

    Code:
    RewriteRule^portfolio/(.*)$ /$1 [L,R=301,QSA]

    Thanks for help!

    Julija
     
  6. proson

    proson Registered Member

    Joined:
    Apr 9, 2013
    Messages:
    99
    Likes Received:
    4
    I think he is asking about permalink structure; But did you put your portfolios under the category portfolio? and then have the permalink structure like /%category%/%postname%/ ?
     
  7. bojana

    bojana Junior Member

    Joined:
    Jan 28, 2010
    Messages:
    185
    Likes Received:
    157
    Location:
    Europe
    Portfolio is a custom post structure in this theme and doesn't fall under the /%category%/ permalink structure.
    With this rule that I used in my .htaccess file I redirected all posts from domain.com/portfoli/1 to domain.com/1:

    Code:
    RewriteRule^portfolio/(.*)$ /$1 [L,R=301,QSA]

    Case closed :)
    Thank you.