WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Mod_rewrite, htaccess works but IE! (4 posts)

  1. Lrrr
    Member
    Posted 9 months ago #

    First excuse me, if somewhere here is similar post I've searching in topics which returns no results at all.

    Generally, my rewrite code works in all browsers except IE which returns "Can not display page" even not 404. That exactly why I hate sometimes have something to do with web developing (Im not profesional at least, ufff). Yes code is poetry, but only for geniuses.

    I cant figure out of this. I dont even understand why its happens even if so far I know code in .htaccess runs on server side. So why the fuck IE not works?!

    Let me brings my code in daylight:

    in .htaccess I have code:
    RewriteRule ^fotografie/tag/([^/]+)/([0-9^/]+)/?$ http://www.danielkral.cz/index.php?attachment_tag=$1&mla_paginate_current=$2 [NC]
    (if advice, please consider that I tried parameters changing, url without index.php- only query, relative url... etc)
    and if I comment that row IE works but not giving redirect results understand? So I know this code causes the trouble. FF, Opera accepts these lines without questions. But IE!

    Whyyyyy this happens ? I google for this question, someone had to face to that similar way but nothing worked for me.
    You can visit http://www.danielkral.cz/fotografie/tag/atelier/3 even on mobile device but not in IE. Im so angry for that!

    info:
    http://www.danielkral.cz/fotografie/tag/atelier?mla_paginate_current=3 works in IE - not now its redirected to nice urls as it should be right! (if you click now you will be redirected to above mentioned url, so happens what I try solve now, but without that redirect back to nice urls it works)

    PS: This issue is for make MLA plugin works with nice and custom urls in first way I did, even better codes maybe happens from beter coders. So If you'll be interested check http://wordpress.org/support/topic/pagination-87?replies=6 there I will add solution to finaly get it work. I totally recomend that plugin. Author of this masterpiece is such a genius for whom code is poetry...

  2. Lrrr
    Member
    Posted 9 months ago #

    Also in functions.php file must be the code:

    function mlagallery_add_rewrite_rules() {
       //  ruled altogether with htaccess  - works only if its here and also same rule in htaccess ?!? what !? :D    
    
        add_rewrite_rule('fotografie/tag/([^/]+)/?([^/]+)?/?$',
       'index.php?attachment_tag=$matches[1]&mla_paginate_current=$matches[2]',
       'top'); /**/
    }
    add_filter('init', 'mlagallery_add_rewrite_rules');
    function wpa_query_vars( $query_vars ) {
        array_push($query_vars, "attachment_tag", "mla_paginate_current");
        return $query_vars;
    }
    add_filter( 'query_vars', 'wpa_query_vars' ); /**/

    So thats code. In php nothing changed if commenting out htaccess and mentioned above.

    As you can see, rule in php handles also attachment_tag redirect which is working. So supposing something after that can cause issue.

  3. Lrrr
    Member
    Posted 9 months ago #

    I made it! about 3 days on it and have resolved - as I suspecting it was a tiny thing which causes it at all.

    RW must not be:
    RewriteRule ^fotografie/tag/([^/]+)/([0-9^/]+)/?$ http://www.danielkral.cz/index.php?attachment_tag=$1&mla_paginate_current=$2 [NC]
    It must be:
    RewriteRule ^fotografie/tag/([^/]+)/([0-9^/])/?$ index.php?attachment_tag=$1&mla_paginate_current=$2 [NC]

    I will write an article because this means, that way to have MLA galerry plugin paginated and with nice url's is fully working now. Maybe its not in the best way but I cant do it better now and I feel fine :D

  4. Lrrr
    Member
    Posted 9 months ago #

Reply

You must log in to post.

About this Topic