Support » Plugin: Redirection » redirect sub folder to main domain

Viewing 10 replies - 1 through 10 (of 10 total)
  • Try:

    Source url: ^/v2/(.*)
    Regex: ticked
    Target url: /$1
    Type: 301 Moved permanently

    My clients’ WordPress install is on Yahoo SB, so when i used the above expression, the URL looks like:

    Is there an expression that would eliminate the /index.php/ part of the URL?

    Thanks for any help in advance!


    First of all: you ought to open a new thread for a new question.

    Secondly, I haven’t got a clue about Yahoo SB, but to be honest it looks like you haven’t set up permalinks properly as otherwise you shouldn’t get the index.php. Go to your settings, check the permalinks settings and make sure you add the correct directives to your .htaccess file.

    So basically it looks like your question doesn’t have anything to do with the redirection plugin.

    Good luck.

    There’s a good chance that the index.php part of the URL means IIS (Windows) servers, not Linux. I’m having similar difficulties with developing wordpress for an e-commerce site, especially with htaccess vs web-config. You might wanna check.

    having the same issue as @arathol. The suggestion by @jrf didn’t work?


    @vitamineg are you really having the same issue ? Then the solution *would* work. Otherwise it’s not exactly the same, so specify the differences as we can’t read minds, you know…

    Hmmm…. I sure think I am?

    I am using John Godley’s “redirection” plugin and followed your steps above. Didn’t seem to redirect the sub-directory landing page or any pages within the directory.

    Reading minds would be nice! 😉

    I have a subdomain using WP which has a sub-directory ..

    I would like to redirect the sub-directory and all pages within it back to the top level domain (TLD)…or even Subdomain.

    i.e. AND 301’d to or

    Thanks @jrf

    Ok, your question seems to have two parts:
    1) how to redirect subdirectory pages to the root directory (of the same domain). That can be done with the Redirection plugin following the steps outlined above – obviously replacing ‘v2’ in the regex with the name of your subdirectory.

    2) and here is the crux: you want to redirect between main domain and subdomain – that is very different from the original question and I would very strongly advise against doing that via the Redirection plugin.
    Simple reason is that you are using a hammer when a very small nail would suffice, i.e if you’d use the plugin, WP would need to be loaded before any redirection would occur, which is extremely inefficient.
    On that note: that might be the reason why it’s not working in 1). Is WP even being loaded for the original request page ?

    Ok, to sum up:
    Use the right tool, i.e. .htaccess. IMPORTANT: Place the .htaccess file in the subdomain root ( and in the root of any sub.subdomains (

    In this .htaccess file place the following line:

    RedirectMatch permanent   ^/subdirectory/(.*)$$1

    You should place this anywhere before this snippet (if it exists in your .htaccess file):

    <IfModule mod_rewrite.c>
    RewriteEngine On

    Let me know how you get on.


    Thank you so much for your input.
    Yahoo SB *does not allow htaccess* in any way, shape or form.
    Also, Yahoo SB does not use permalinks per se, but uses their own *proprietary (as in fubar) permalinks plug-in*.
    After using redirect with the above expression,
    I still end up with /index.php/ subdirectory in the URL:
    I have opened up a new thread but have not received a reply?
    Thanks in advance for your help!

    @jim-jammer sounds like this is a problem with the proprietary permalinks plugin, not with redirection. As I am not familiar with their plugin, I can’t help you. If that plugin is listed in the WP plugin directory, would be to open up a thread in their forum.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘redirect sub folder to main domain’ is closed to new replies.