• Resolved olavxxx

    (@olavxxx)


    Hi, hope my title was ok ??

    I am converting a working site (that I made) to multisite.
    Inside the functions.php I have a regexp for custom feed rewriting.

    I think it must collide with the htaccess code that the multisite told me to replace the contents inside the htaccess file with.

    My current htaccess:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    Then I have this rewrite inside the functions.php:

    function custom_feed_rewrite($wp_rewrite) {
    	$feed_rules = array(
    		'feed/(.+)' => 'index.php?feed=' . $wp_rewrite->preg_index(1),
    		'(.+).xml' => 'index.php?feed='. $wp_rewrite->preg_index(1)
    	);
    	$wp_rewrite->rules = $feed_rules + $wp_rewrite->rules;
    }
    add_filter('generate_rewrite_rules', 'custom_feed_rewrite');

Viewing 1 replies (of 1 total)
  • Thread Starter olavxxx

    (@olavxxx)

    Sorry, my bad!

    There was nothing wrong here, it was my JQuery file with XMLHTTPREQUEST that tried to cross domains (it tried accessing the old domain instead of the new, but this was not related to the redirect).

Viewing 1 replies (of 1 total)
  • The topic ‘WordPress multisite – Rewrite multisite functions.php’ is closed to new replies.