Support » WP-Advanced » Redirect permalink only with mod rewrite.

Redirect permalink only with mod rewrite.

  • Hi!
    I moved my wordpress weblog to a subdomain, leaving in the main domain an aggregator page. Now I would like to redirect permalink requests to the new domain, leaving the access to the main page intact.
    Basically, what I’m trying to do is to redirect all the addresses of this kind:


    leaving access to kurai.eu and all the other standard subdirectory intact.

    I tried this rule:
    RewriteRule ^kurai\.eu/([0-9]+)/$ http://insertcoin.kurai.eu/$1/ [R=301,NC,L]
    but it seems not working. Obviously I’ve got problems with regular expressions. Can you help me out with this?

    Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • heiseheise


    Did you ever get this figured out, Kurai? I’m trying to do the exact same thing that you are, except backwards – I’m moving from http://www.heiseheise.com/blog to http://www.heiseheise.com with my blog files and so I have a whole ton of old links just lying around to /blog that now redirect to nothing.

    I’d like to make it so that they’ll automatically drop the /blog from the URL and just go to the /?=%number% instead!

    please let me know if you were successful; we can probably reverse engineer it!

    heiseheise, you’d be better served doing a search/replace on your database, to change those links in your old posts.

    Have you figured it out, heiseheise?

    I have here an .htaccess rewrite that moves all requests for http://domain.com/blog to http://domain.com

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^blog/?(.*) /$1 [R=301,L]

    example: a request for http://domain.com/blog/2008/06/hello-world/ will now be directed to http://domain.com/2008/06/hello-world/

    @kurai: The problem with your regex is that you’re only selecting a series of digits with [0-9]. You need to be selecting all the characters, basically, so the correct expression would be:

    RewriteRule ^kurai\.eu/(.+)/$ http://insertcoin.kurai.eu/$1/ [R=301,NC,L]



    wesg, that doesn’t work… Because for example with that code we can’t acceed to admin panel, or acceed to CSS styles, etc.

    I really need help on this.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Redirect permalink only with mod rewrite.’ is closed to new replies.