.htaccess Question (12 posts)

  1. Lester Chan
    Posted 9 years ago #

    Is It possible to redirect to other htaccess beside index.php?

    I have tried, but it just don't work

    function print_config() {
    global $wp_rewrite;
    $print_post_rules = array('archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/print/?$' => 'wp-print.php?year='.$wp_rewrite->preg_index(1).'&monthnum='.$wp_rewrite->preg_index(2).'&day='.$wp_rewrite->preg_index(3).'&name='.$wp_rewrite->preg_index(4));
    $print_page_rules = array('(.+)/printpage/?$' => 'wp-print.php?pagename='.$wp_rewrite->preg_index(1));

    $wp_rewrite->rules = $print_page_rules + $wp_rewrite->rules + $print_post_rules;
    add_filter('generate_rewrite_rules', 'print_config');

  2. Mazalien
    Posted 9 years ago #

    Gamerz, I saw your other post about this subject. Ryan Boren had ask me to use a plugin of him to debug the problem with the .htaccess file. See this topic , perhaps you should do the same.
    Other topics with the same problems are ;


    Greetings Mazalien

  3. Lester Chan
    Posted 9 years ago #

    thanks Mazalien for the reply. Erm. I do not have problem with my htaccess, I want to addon htaccess to it and I was wondering why it will not work.

  4. Mazalien
    Posted 9 years ago #

    Well Gamerz in this topic you talked about an almost empty .htaccess file, so I have that kind of problems. Do you know the solution then ?

  5. Ryan Boren
    WordPress Dev
    Posted 9 years ago #

    The .htaccess file is supposed to be almost empty. htaccess redirects to WP which then takes care of doing the rewriting.

    Plugins that used the mod_rewrite_rules filter need to use the generate_rewrite_rules action instead. generate_rewrite_rules has been the preferred method for some time, but Codex was still referencing mod_rewrite_rules.

    The feed director plugin shows the usage of generate_rewrite_rules.

  6. Lester Chan
    Posted 9 years ago #

    ryan: thanks for the reply, I am using the feed redirector for ref, but apparently I have no idea why it will not work, the rewrite rule works when it is being redirected to index.php. It will not work if i redirect to wp-print.php. I have posted the code above, will you be so kind to help me with it?

  7. Philipp Berndt
    Posted 9 years ago #

    i had the same problem, i deactivated "Lucky 13 Rewrite" and problem solved

  8. Lester Chan
    Posted 9 years ago #

    I am going to rewrite wp-print to go about it. So far so good

  9. doggybag
    Posted 8 years ago #

    I am trying to set up a wordpress based blog on the site but am having problems with permalinks to the pages ...

    The blog is running fine on another server -- I have moved over the db and set up everything an exact copy as the original..

    I can see the blog quite happily here;

    but attempting to click on any of the links brings up a file not found and checking on the URL of the link reveals that an extra piece of code is being inserted on all links

    that should actually read:

    the /index.php/ part has be inserted from somewhere.

    any ideas where I should be looking to resolve this problem ?


  10. vkaryl
    Posted 8 years ago #

    Set your .htaccess file to 666 or 777 (whichever will work on your server), visit the permalinks section of wp-admin, and set the permalinks back to default (just to clear things out a bit), click the update button, then set them back to how you want them to display, click the update button, then go change your .htaccess file back to 644.

    See if that helps.

  11. doggybag
    Posted 8 years ago #

    thanks vkaryl but it would seem that I have got the whole thing wrong from start to finish

    I have set up and run 20+ blogs on http://www.barganews.com over the past year ... I am in the process of moving all of this stuff over onto a new server

    This is was the techs on the new server have just imformed me:

    Since you're on a windows based server .htaccess file doesn't get applied since it's file for apache web server, though we provide IIS servers on windows based accounts.

    The worpress software must meet the server requirements to be installed and work properly: disable register_globals, set special permissions... This may not be done on the Windows plan. It is only possible to run the software successfully on the Linux plan.

    So that's that then !!!


  12. vkaryl
    Posted 8 years ago #

    Oy. Yes, that does make a MAJOR difference. Though I do believe wp can run "successfully" on a windows server.... but not with permalinks, and perhaps not under the setup this host is using.

    Maybe get the host to switch you to a linux server instead?

Topic Closed

This topic has been closed to new replies.

About this Topic