Title: needforbeans's Replies | WordPress.org

---

# needforbeans

  [  ](https://wordpress.org/support/users/needforbeans/)

 *   [Profile](https://wordpress.org/support/users/needforbeans/)
 *   [Topics Started](https://wordpress.org/support/users/needforbeans/topics/)
 *   [Replies Created](https://wordpress.org/support/users/needforbeans/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/needforbeans/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/needforbeans/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/needforbeans/engagements/)
 *   [Favorites](https://wordpress.org/support/users/needforbeans/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[LiteSpeed Cache] Undefined index: SCRIPT_URI](https://wordpress.org/support/topic/undefined-index-script_uri/)
 *  [needforbeans](https://wordpress.org/support/users/needforbeans/)
 * (@needforbeans)
 * [5 years, 12 months ago](https://wordpress.org/support/topic/undefined-index-script_uri/#post-12831340)
 * The error comes up because the server doesn’t even have a SCRIPT_URI index in
   the array. You can solve the error by replacing the serve_static function in 
   the file router.cls.php with this:
 *     ```
       public static function serve_static()
       	{
       		if( array_key_exists('SCRIPT_URI', $_SERVER)) {
   
       			if ( strpos( $_SERVER[ 'SCRIPT_URI' ], LITESPEED_STATIC_URL . '/' ) !== 0 ) {
       				return ;
       			}
   
   
   
       			$path = substr( $_SERVER[ 'SCRIPT_URI' ], strlen( LITESPEED_STATIC_URL . '/' ) ) ;
       			$path = explode( '/', $path, 2 ) ;
   
       		}
   
       		if ( empty( $path[ 0 ] ) || empty( $path[ 1 ] ) ) {
       			return ;
       		}
   
       		switch ( $path[ 0 ] ) {
       			case 'avatar' :
       				Avatar::get_instance()->serve_satic( $path[ 1 ] ) ;
       				break ;
   
       			case 'cssjs' :
       				Optimize::get_instance()->serve_satic( $path[ 1 ] ) ;
       				break ;
   
       			default :
       				break ;
       		}
   
       	}
       ```
   
 * If you don’t want to edit code, just replace the whole router.cls.php file with
   this: [https://pastebin.com/gtbbJ006](https://pastebin.com/gtbbJ006)
    -  This reply was modified 5 years, 12 months ago by [needforbeans](https://wordpress.org/support/users/needforbeans/).

Viewing 1 replies (of 1 total)