Search Results

Search found 853 results on 35 pages for 'redirection'.

Page 7/35 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • nginx + apache subdomain redirection fault

    - by webwolf
    i really need your advice folks since i'm experiencing some troubles with nginx & apache2 subdomains configs first of all, there's a site (say, site.com) and two subdomains (links.site.com and shop.site.com) whose files are physically located at the same level of FS hierarchy as the site.com itself my hoster has configured both apache and nginx by my request, but it still doesn't work as it used to both of subdomains point to the main page of site.com for some unknown and implicit (for me) reason :( my assumption is that's happen because site.com record is placed first in both configs?!.. please help me solve this out! every opinion would be appreciated =) nginx.conf: server { listen 95.169.187.234:80; server_name site.com www.site.com ; access_log /home/www/site.com/logs/nginx.access.log main; location ~* ^.+\.(jpeg|jpg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|swf|avi|mp3|mpg|mpeg|asf|vmw)$ { expires 30d; root /home/www/site.com/www; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # location ~ /\.ht { deny all; } location / { set $referer $http_referer; proxy_pass http://127.0.0.1:8080/; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Referer $referer; proxy_set_header Host $host; client_max_body_size 10m; client_body_buffer_size 64k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; } } server { listen 95.169.187.234:80; server_name links.site.com www.links.site.com ; access_log /home/www/links.site.com/logs/nginx.access.log main; location ~* ^.+\.(jpeg|jpg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|swf|avi|mp3|mpg|mpeg|asf|vmw)$ { expires 30d; root /home/www/links.site.com/www; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # location ~ /\.ht { deny all; } location / { set $referer $http_referer; proxy_pass http://127.0.0.1:8080/; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Referer $referer; proxy_set_header Host $host; client_max_body_size 10m; client_body_buffer_size 64k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; } } server { listen 95.169.187.234:80; server_name shop.site.com www.shop.site.com ; access_log /home/www/shop.site.com/logs/nginx.access.log main; location ~* ^.+\.(jpeg|jpg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|swf|avi|mp3|mpg|mpeg|asf|vmw)$ { expires 30d; root /home/www/shop.site.com/www; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # location ~ /\.ht { deny all; } location / { set $referer $http_referer; proxy_pass http://127.0.0.1:8080/; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Referer $referer; proxy_set_header Host $host; client_max_body_size 10m; client_body_buffer_size 64k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; } } httpd.conf: # ServerRoot "/usr/local/apache2" PidFile /var/run/httpd.pid Timeout 300 KeepAlive On MaxKeepAliveRequests 100 KeepAliveTimeout 15 Listen 127.0.0.1:8080 NameVirtualHost 127.0.0.1:8080 ... #Listen *:80 NameVirtualHost *:80 ServerName www.site.com ServerAlias site.com UseCanonicalName Off CustomLog /home/www/site.com/logs/custom_log combined ErrorLog /home/www/site.com/logs/error_log DocumentRoot /home/www/site.com/www AllowOverride All Options +FollowSymLinks Options -MultiViews Options -Indexes Options Includes Order allow,deny Allow from all DirectoryIndex index.html index.htm index.php ServerName www.links.site.com ServerAlias links.site.com UseCanonicalName Off CustomLog /home/www/links.site.com/logs/custom_log combined ErrorLog /home/www/links.site.com/logs/error_log DocumentRoot /home/www/links.site.com/www AllowOverride All Options +FollowSymLinks Options -MultiViews Options -Indexes Options Includes Order allow,deny Allow from all DirectoryIndex index.html index.htm index.php ServerName www.shop.site.com ServerAlias shop.site.com UseCanonicalName Off CustomLog /home/www/shop.site.com/logs/custom_log combined ErrorLog /home/www/shop.site.com/logs/error_log DocumentRoot /home/www/shop.site.com/www AllowOverride All Options +FollowSymLinks Options -MultiViews Options -Indexes Options Includes Order allow,deny Allow from all DirectoryIndex index.html index.htm index.php # if DSO load module first: LoadModule rpaf_module modules/mod_rpaf-2.0.so RPAFenable On RPAFsethostname On RPAFproxy_ips 127.0.0.1 RPAFheader X-Forwarded-For Include conf/virthost/*.conf

    Read the article

  • iptables port redirection on Ubuntu

    - by Xi.
    I have an apache server running on 8100. When open http://localhost:8100 in browser we will see the site running correctly. Now I would like to direct all request on 80 to 8100 so that the site can be accessed without the port number. I am not familiar with iptables so I searched for solutions online. This is one of the methods that I have tried: user@ubuntu:~$ sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT user@ubuntu:~$ sudo iptables -A INPUT -p tcp --dport 8100 -j ACCEPT user@ubuntu:~$ sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8100 It's not working. The site works on 8100 but it's not on 80. If print out the rules using "iptables -t nat -L -n -v", this is what I see: user@ubuntu:~$ sudo iptables -t nat -L -n -v Chain PREROUTING (policy ACCEPT 14 packets, 2142 bytes) pkts bytes target prot opt in out source destination 0 0 REDIRECT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 redir ports 8100 Chain INPUT (policy ACCEPT 14 packets, 2142 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 177 packets, 13171 bytes) pkts bytes target prot opt in out source destination Chain POSTROUTING (policy ACCEPT 177 packets, 13171 bytes) pkts bytes target prot opt in out source destination The OS is a Ubuntu on a VMware. I thought this should be a simple task but I have been working on it for hours without success. :( What am I missing?

    Read the article

  • Issue with domain redirection

    - by phphunger
    I have a flash games website which is hosted at godaddy server. But because of heavy traffic on my site the godaddy server gets down. So I changed the hosting to Midphase server. The strange thing is i have created new name servers and new database in my mid phase server but still the web site is coming from the godaddy server. When i do any modifications from the godaddy ftp i am getting the modifications but when i do any modifications in the mid phase server. No changes are happening. One strange thing is the who.is is showing the new name servers and new server details but not getting the new servers contents. Can anyone help me in this regard?

    Read the article

  • Point Subdomain to another application on another domain

    - by Juanu Haedo
    I'm not a very experienced Server Administrator and I'm trying to set up a new one I just got. I'm Using IIS7 and DNS Server What I need is that a url such as: mail.domainA.com points to www.domainB.com/webmail And I want to do this for all other domains... I want all of my domains that start with mail., point to www.domainB.com/webmail In short: I need a Subdomain to redirect to another URL... An improvement would be to let the subdomain as it is on the address bar on the redirection, if possible... Any help?

    Read the article

  • SQL Server Redirection

    - by MrTehee
    We are switching from a SQL cluster to a mirrored solution. The problem is that we have a bunch of programs that would have to switch connection strings to handle the failover. Is there any way the we can set up a redirect or proxy that would take any legacy requests and forward them to the mirrored solution?

    Read the article

  • Roaming Profiles & Redirected Folders - storage consumption? offline files and caching?

    - by Ben Swinburne
    I understand the concepts of both roaming profiles and folder redirection and have used both separately before. I am about to set up a network from scratch and would ideally like to use both for the following reasons primarily Roaming profiles allow users to log on to any machine and have their profile Redirected profiles allow users to have their My Documents and Desktop etc backed up without the need to log off at the end of the day. The servers can run their backups overnight and there are no missing files due to the user not logging off. Redirected profiles largely alleviate the slow log in times caused by large profiles. My question is if some of the folders are redirected and therefore not part of the roaming profile what happens on machines which truly roam (i.e. laptops)? If there's offline files or a cache does this mean that the problem whereby a user has to log off comes back? By having them both enabled, is there any duplication i.e. if I have a users$ share and a profiles$ share would I have Desktop twice for example?

    Read the article

  • Bash/shell script - shell output redirection inside a function

    - by Josh
    function grabSourceFile { cd /tmp/lmpsource wget $1 > $LOG baseName=$(basename $1) tar -xvf $baseName > $LOG cd $baseName } When I call this function The captured output is not going to the log file. The output redirection works fine until I call the function. The $LOG variable is set at the top of the file. I tried echoing statements and they would not print. I am guessing the function captures the output itself? If so how do push the output to the file instead of the console. (The wget above prints to console, while an echo inside the function does nothing.)

    Read the article

  • Cheat sheet exhibiting bash shell stdout/stderr redirection behavior

    - by SetJmp
    Is there a good cheat sheet demonstrating the many uses of BASH shell redirection? I would love to give such a thing to my students. Some examples I'd like to see covered: cmd > output_file.txt #redirect stdout to output_file.txt cmd 2> output_file.txt #redirect stderr to output_file.txt cmd >& outpout_file.txt #redirect both stderr and stdout to output_file.txt cmd1 | cmd2 #pipe cmd1 stdout to cmd2's stdin cmd1 2>&1 | cmd2 #pipe cmd1 stdout and stderr to cmd2's stdin cmd1 | tee result.txt #print cmd1's stdout to screen and also write to result.txt cmd1 2>&1 | tee result.txt #print stdout,stderr to screen while writing to result.txt (or we could just make this a community wiki and enumerate such things here) Thanks! SetJmp

    Read the article

  • NDIS or TDI for packet redirection to a local proxy

    - by Enrico Detoma
    I need to develop a transparent filter to redirect outgoing HTTP packets to a local proxy, to do transparent content filtering. Which is the best technology to do it, TDI or NDIS IM? My main constraint is to avoid conflicts with antivirus software, which also do some kind of packet redirection to inspect HTTP content (I don't know whether antivirus programs use TDI, NDIS IM, or both). Rather than writing the driver myself, actually, I'm also considering two commercial SDKs for packet filtering/modification: one uses a TDI driver while the other uses a NDIS IM driver, so that's the origin of my question (I was only aware of NDIS IM, before looking at the two SDKs).

    Read the article

  • apache mod_rewrite redirection problem

    - by warttack
    ok i am having a problem with redirection on apache, i have a domain configured on my hosting account but the domain needs to be redirected to a folder. eg: / is root of server where the mysite.com answers /mysite is where the files are so i got this htaccess code to do the job: Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$ RewriteCond %{REQUEST_URI} !^/mysite/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /mysite/$1 RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$ RewriteRule ^(/)?$ mysite/index.php [L] plus i made an index.php to redirect to mysite folder. everything seems to be working good the only problem is i added a forum on /mysite/forums/ and for some reason instead of getting mysite.com/forums/ in the browser im getting mysite.com/mysite/forums/ could anyone help me solve this problem? Thanks in advance!

    Read the article

  • How to handle redirection in an Ajax based application

    - by nimo
    hi all, I'm developing a Ajax based php application. As anybody knows, I'm checking whether user is logged in every php file as the first statement. And there are two ways that I should response in an event of logging failure, server redirect to the login page using header(url). CASE: If user directly enter a particular URL passing url in Ajax response asking client side page redirection or notification CASE: If user trying to perform some action through a Ajax request So my question is how can identify whether request coming from client side is a Ajax call or not ? If I know that I can handle my response accordingly. OR Is there a better way of handling above scenario ? Thank You

    Read the article

  • phonegap crossplatform redirection to local file

    - by Marco Gagliardi
    Hi I'm developing a phonegap + JQueryMobile app, which should be correctly executed on Android, iOs and WindowsPhone as well. I need to exploit an external service wich requires one callback url to redirect the app to in case of success, and one in case of error (pretty common situation. In my case both will be local files, say www/success.html and www/error.html). Of course I could write different paths for each device (e.g. file:///android_asset/www/success.html on Android), but i'm wondering if the framework provide a more simple elegant solution. So the questions is, how can i get a unique absolute URL wich allows me to perform a cross-platform HTTP redirection from a remote web page to a local file within a phonegap application? Thanks

    Read the article

  • php script redirecting code problem

    - by tibin mathew
    hi, i'm using a php script for redirection after detecting the search word to my websiter from the search engines . and my redirection code is working fine but for some keywods i wat to stay in the same page. for that lines of code i'm getting a warning message in that pages. Warning: headers already sent (output started at /home/friendsj/public_html/index.php:2) in /home/friendsj/public_html/index.php on line 20 below is the code i used in that pages $ref=$_SERVER['HTTP_REFERER']; if(strstr($ref,"test")) { $url="http://www.howtomark.com/robgoyette.html"; } elseif(strstr($ref,"mu+word+gmail")) { $url="http://www.howtomark.com/marketbetter.html"; } else { if(strstr($ref,"how+to+market+better")) { } } if($url !="") { header("Location:$url"); }

    Read the article

  • Javascript parent page redirection from iframe.

    - by Danil
    Hello to all. I need to implement parent page redirection from iframe. I know that it is impossible to do in different domains due to browsers security. However I found that links have target attribute and tried to use it in the following way: <a href="http://google.com" target="_top" id="testParentRedirect">someLink</a> It works fine if I click this link manually, but I couldn't find cross-browser solution to simulate it using javascript. document.getElementById('testParentRedirect').click(); This works fine in IE, however Firefox and Safary don't know click function :). I tried to work with jquery, but for some reason they don't simulate click event for links. (see following post) I couldn't find any appropriate solution on stackoverflow. Maybe someone could help me in it. I will appreciate it. :)

    Read the article

  • Django test client gets 301 redirection when accessing url

    - by Michal Klich
    I am writing unittests for django views. I have observed that one of my views returns redirection code 301, which is not expected. Here is my views.py mentioned earlier. def index(request): return render(request, 'index.html', {'form': QueryForm()}) def query(request): if request.is_ajax(): form = QueryForm(request.POST) return HttpResponse('valid') Below is urls.py. urlpatterns = patterns('', url(r'^$', 'core.views.index'), url(r'^query/$', 'core.views.query') ) And unittest that will fail. def so_test(self): response = self.client.post('/') self.assertEquals(response.status_code, 200) response = self.client.post('/query', {}) self.assertEquals(response.status_code, 200) My question is: why there is status 301 returned?

    Read the article

  • Domain Redirection While Maintaining Original URL

    - by Steve
    I have two domains ("this_site.com" and "that_site.com") that I want to point to the same place (same set of files). BUT What I really want to do is maintain the original URL in the address bar while the visitor accesses the different pages. Example: The primary domain holding the web files is "this_site.com". If I type in "that_site.com" in the address bar, I want the address bar to keep displaying "that_site.com" no matter where they go on the web site. Normal domain redirection causes the URL displayed in the address bar to change to the 'master' domain (i.e. the visitor that typed in "that_site.com" will see the address bar's URL change to "this_site.com"). Is there some sort of .htaccess trick that I can employ to do this? What I'm trying to do is NOT confuse visitors who visit one URL and find themselves on a different URL as well as avoid the additional expense and trouble of having to maintain two separate hosting accounts.

    Read the article

  • Hilighting div tag in Masterpage on redirection to content page

    - by user1713632
    I have a link in Master page within a div tag. I want to highlight the div when I am clicking the link, in order to redirect to some content page. I have written the following code: <li> <div id="div_test" runat="server"> <asp:LinkButton ID="lnk_test_menu" Font-Underline="false" ForeColor="Black" runat="server" Text="Test Link" CausesValidation="false" onclick="lnk_test_menu_Click1" > </asp:LinkButton></div> </li> Code in the cs page: protected void lnk_test_menu_Click1(object sender, EventArgs e) { div_test.Attributes.Add("class", "testSelected"); Response.Redirect(Test.aspx"); } The div in the master page is not being selected on redirection. Could anybody help me on this?

    Read the article

  • how to make several redirection

    - by Olesya Manevich
    Right now I am updating my web site and I want to change all links to non-extension links like example.com/test.php to example.com/test. THis solution I found I put in .htaccess file: RewriteCond %{THE_REQUEST} ^GET\ /(([^/?]*/)*[^/?]+)\.php RewriteRule ^.+\.php$ /%1 [L,R=301] But at the same time I need to make redirection for links what located in lower level of my web-site like example.com/level/test2.php to example.com/test2.php. What should I write in .htaccess to redirect my files from lower level to higher and remove .php extension at the same time? p.s. Thank you very much! and sorry for my poor English.

    Read the article

  • apache htaccess rewrite rules make redirection loop

    - by Ali
    Hi guys, Have a very strange problem with Apache .htaccess URL Rewriting and Redirection. Here's my setup: I have a zend application with a single point of entry (index.php) directly under my apache document root (call this the "public" folder). I also have all other public files (images, js, css, etc.) under the public folder. Here, I also have a wordpress blog under the "blog" folder. There's an empty test folder too The Problem When I go to mydomain.com/blog, I get redirected to http://www.theredpin.com/blog (correctly), then to http://www.theredpin.com/blog/ (just with an extra / at end), finally to http://theredpin.com/blog/ -- and we're back where we started. The loop continues. What I don't understand is why would wordpress try to remove the www? I'm guessing it's wordpress because my empty test folder acts just fine! PLEASE HELP. I"M REALLY DESPERATE :( Thank you very much Other things that happen: When I go to mydomain.com, i correctly get redirected to www.mydomain.com When I go to www.mydomain.com, i correctly stay where I am When I go to www.mydomain.com/test or mydomain.com/test, behaviour is correct. Setup So my .htaccess file does the following: If there's no www., then add it and do a 301 redirect. Here's the code I use RewriteCond %{HTTP_HOST} ^mydomain.com [NC] RewriteRule ^(.*)$ http://www.mydomain.com/$1 [L,R=301] If the request is NOT for a resource (image, etc.), or the blog, then load zend application by rewriting to index.php RewriteRule !((^blog(/)?.*$)|(.(js|ico|gif|jpg|jpeg|png|css|cur|JPG|html|txt))$) index.php Thanks again for all your help!!! Ali

    Read the article

  • Google Contacts API - No Redirection

    - by mecablaze
    Hello there, I am currently working on Contact Importer web app (in PHP) so I will be able to grab email address from a user's account on Gmail, Yahoo, etc and use them for my own evil purposes. Just kidding, my web app is very friendly. I thought I would start with Google. I found they have a fantastic little API called Google Contacts API which lets a programmer, like myself, to access a user's contacts. After a couple of hours of struggling and throwing shitty code together, I ran into a few road-blocks. My main question is this: Is there any way that I can have a user provide their username and password for Gmail on my website and have my code retrieve the contacts without that nasty redirection to a Google login page? It's kind of ruins the whole flow of my web app. I've looked into AuthSub, and gotten that to work, but of course the catch is that you have to redirect the user to obtain the access token. It looks like OAuth will have this same catch. The one ray of hope I have is the ClientLogin method of authentication. Again, there is a catch, sometimes Google throws you a CAPTCHA instead of the auth token. Again, the user flow is ruined. I've noticed that our good ol' friends over at Twitter have it working just fine. Does anyone know how they do it? Thanks!

    Read the article

  • Redirection fails in IE but is fine with Firefox

    - by Bob
    I use an <Authorize> attribute in ASP.NET MVC to secure a controller. My page loads portions of its content via AJAX. Here's a problem I have with IE8, but not Firefox 3.6: Sign in as user JohnDoe and navigate to http://www.example.com/AjaxPage. Everything works fine. AjaxPage is protected with the <Authorize> attribute. Sign out, which redirects me to http://www.example.com. That page doesn't use <Authorize>. Navigate to http://www.example.com/AjaxPage without signing in again. I should be redirected to the Sign In page since that controller has the <Authorize> attribute. Step 3 works with Firefox, but IE8 displays the non-Ajax portion of http://www.example.com/AjaxPage and then never loads the Ajax content. I'm surprised any content is displayed at all since I should be redirected to the Sign In page. My code redirects to the login page with: Return Redirect("https://login.live.com/wlogin.srf?appid=MY-APP-ID&alg=wsignin1.0") Why does Firefox handle this redirection, but IE doesn't? Since it works the first time (Step 1 above), is there a cache issue?

    Read the article

  • Redirection fails in IE but is fine with Firefox

    - by Bob
    I use an <Authorize> attribute in ASP.NET MVC to secure a controller. My page loads portions of its content via AJAX. Here's a problem I have with IE8, but not Firefox 3.6: Sign in as user JohnDoe and navigate to http://www.example.com/AjaxPage. Everything works fine. AjaxPage is protected with the <Authorize> attribute. Sign out, which redirects me to http://www.example.com. That page doesn't use <Authorize>. Navigate to http://www.example.com/AjaxPage without signing in again. I should be redirected to the Sign In page since that controller has the <Authorize> attribute. Step 3 works with Firefox, but IE8 displays the non-Ajax portion of http://www.example.com/AjaxPage and then never loads the Ajax content. I'm surprised any content is displayed at all since I should be redirected to the Sign In page. My code redirects to the login page with: Return Redirect("https://login.live.com/wlogin.srf?appid=MY-APP-ID&alg=wsignin1.0") Why does Firefox handle this redirection, but IE doesn't? Since it works the first time (Step 1 above), is there a cache issue? EDIT: I used Fiddler to see if AjaxPage was being cached, but it appears not to be. I assume if it were cached, I'd get an HTTP Status Code 200 back. I may simply misunderstand this though.

    Read the article

  • PHP Header redirection problem within page called by cURL

    - by Das123
    I have a site that uses cURL to access some pages, stores the returned results in variables, and then uses these variables within its own page. The script works well except where the target cURL page has a header('Location: ...') command inside it. It seems to just ignore this header command. The cURL command is as follows... //Load result page into variable so portions can be allocated to correct variables $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); # URL to post to curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 ); # return into a variable curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); $loaded_result = curl_exec( $ch ); # run! curl_close($ch); I've tried changing the CURLOPT_HEADER to 1 but it doesn't do anything. So how can I allow script redirection within the target urls using cURL to grab the results? By the way, the pages work fine if accessed other than via cURL but iFrames are not an option in this instance.

    Read the article

  • Redirection Still not working (updated on earlier question)

    - by NoviceCoding
    So earlier I asked this question: JQuery Login Redirect. Code Included The php file is sending the following: $return['error'] = false; $return['msg'] = 'You have successfully logged in!!'; I've tried all the suggestions, quoting the error on php and ajax end, 2 equals instead of 3, I've also tried DNE true which should be the same as an else statement: $(document).ready(function(){ $('#submit').click(function() { $('#waiting').show(500); $('#empty').show(500); $('#reg').hide(0); $('#message').hide(0); $.ajax({ type : 'POST', url : 'logina.php', dataType : 'json', data: { type : $('#typeof').val(), login : $('#login').val(), pass : $('#pass').val(), }, success : function(data){ $('#waiting').hide(500); $('#empty').show(500); $('#message').removeClass().addClass((data.error === true) ? 'error' : 'success') .text(data.msg).show(500) if(data.error != true) window.location.replace("http://blahblah.com/usercp.php"); if (data.error === true) $('#reg').show(500); $('#empty').hide() }, error : function(XMLHttpRequest, textStatus, errorThrown) { $('#waiting').hide(500); $('#message').removeClass().addClass('error') .text("There was an Error. Please try again.").show(500); $('#reg').show(500); $('#empty').hide(); Recaptcha.reload(); } }); return false; }); And it still wont work. Any ideas on how to make a redirection work if login is successful and error returns false? Also while I am asking, can I put a .delay(3000) 3s at the end of window.location.replace("http://blahblah.com/usercp.php")?

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >