302 Moved Temporarily in jquery ajax in codigniter
<p>I am getting  302 Moved Temporarily error in jquery ajax in codigniter . Please let me know how can i solve this issue.</p>

<p>Some time it working fine but some time it gives issue.</p>

<p>I am unable to remove this error permanently.</p>

<pre><code> $.ajax({
           type: "POST",
           url: base_url+'rep/rep/appointment_nonlunch',
           data: {office_id:id},
           success: function(response){ 
                $('.imgs').attr("src", base_url+"assests/UI/dashboard/images/logo_new-1.png");
                $('#img'+id).attr("src", base_url+"assests/UI/dashboard/images/logo_white.png");
               $('div').removeClass('selected_blue_div');
               $('#'+id).addClass('selected_blue_div');
               $('#Appdetails').html(response);                   

            }
        });



&lt;div id="offices_input" class="min-height-offcie-1 simple-bdr-btm"&gt;
                     &lt;?php 
                     if(count($office_data) != 0){ 
                        foreach($office_data as $office){ 
                     ?&gt; 
                        &lt;?php if($office-&gt;lunchpro_status == 0){ ?&gt;                 
                            &lt;div class="padding_bottom white_bg_maging_b_5 cursor-pointer" onclick="office_detail(this.id)" id="&lt;?php echo $office-&gt;user_id; ?&gt;" &gt;
                                &lt;div class="pading-ofc-24"&gt;
                                &lt;div class="row"&gt;   
                                    &lt;div class="col-md-10 col-sm-9 col-xs-10"&gt;
                                      &lt;h1&gt;&lt;?php echo $office-&gt;office_name;?&gt;&lt;/h1&gt;
                                      &lt;p class="top-padding-p font_24px-color font_p_16_light"&gt;&lt;?php echo $office-&gt;address.' '.$office-&gt;city.', '.$office-&gt;state.' '.$office-&gt;zip;?&gt;&lt;/p&gt;
                                    &lt;/div&gt;
                                    &lt;div class="col-md-2 col-sm-3 col-xs-2"&gt;
                                        &lt;div class="non-lunch-logo-img text-right"&gt;
                                            &lt;img width="60%" alt="" class="imgs lunch-logo-15px" id="img&lt;?php echo $office-&gt;user_id; ?&gt;" src="&lt;?php echo base_url();?&gt;assests/UI/dashboard/images/logo_new-1.png"&gt;
                                        &lt;/div&gt;
                                    &lt;/div&gt;                      
                                &lt;/div&gt;
                                &lt;/div&gt;
                            &lt;/div&gt;
                        &lt;?php }elseif($office-&gt;lunchpro_status == 1){ ?&gt;                        
                            &lt;div class="padding_bottom white_bg_maging_b_5 cursor-pointer" onclick="office_nonlunch(this.id)" id="&lt;?php echo $office-&gt;user_id; ?&gt;" &gt;
                                &lt;div class="pading-ofc-24"&gt;
                                &lt;div class="row"&gt;   
                                    &lt;div class="col-md-12 col-sm-12 col-xs-12"&gt;
                                      &lt;h2&gt;&lt;?php echo $office-&gt;office_name;?&gt;&lt;/h2&gt;
                                      &lt;p class="top-padding-p font_24px-color font_p_16_light"&gt;&lt;?php echo $office-&gt;address.' '.$office-&gt;zip;?&gt;&lt;/p&gt;
                                    &lt;/div&gt;                      
                                &lt;/div&gt;
                                &lt;/div&gt;
                            &lt;/div&gt;                      
                        &lt;?php }
                        }
                    }else{
                    ?&gt;
                        &lt;div class="text-center margin_top font_p_16_b"&gt;No Record Found&lt;div&gt;&lt;/div&gt;&lt;/div&gt;
                    &lt;?php } ?&gt;
                &lt;/div&gt;
</code></pre>

<p><a href="https://i.stack.imgur.com/apsAA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/apsAA.png" alt="enter image description here"></a></p>

<p>thanks</p>