w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Separate Nginx Rewrites
Ok since you said it works let me explain what you did, I'll quote them from the wiki page: First the flag you used which is break break: completes processing of current rewrite directives and non-rewrite processing continues within the current location block only. by adding the keyword break to any rewrite rule, it tells nginx to stop the rewriting, so even if it matches another location which has a rewrite, it wont run it, that's why it didn't execute the rewrites inside the location location / { .. } Another keyword is last, last: completes processing of current rewrite directives and restarts the process (including rewriting) with a search for a match on the URI from all available locations. This one which tells nginx to stop the rewriting and restart rewriting again wi

Categories : Nginx

NGINX rewrites with regular expression
Please try with this try_files $uri/index.html $uri @moved; location @moved { rewrite ^/categories/(.+)-c-(.+)$ "/categories/$1/$2" permanent; } And be careful with the slashes, Since $URI always start with a slash (/), so after redirecting to the new 'moved' scenario it should be like the same.

Categories : Regex

grails.serverURL with Nginx doesn't work properly
grails.serverURL does not have anything to do with the outside url (except for absolute links generated from grails). You can configure your nginx to handle any domain and internally do the proper redirects. The caching you have described is probably due to the browser cache.

Categories : Tomcat

How does the new Magento1.13 EE URL rewrites work/ How do the new database tables relate to each other?
It's difficult to answer your question, as the new Enterprise URL rewrite module has undergone and is still undergoing very significant changes. A stable version is expected with the next release (1.13.0.2), but until then, no one outside of the Magento core team can tell you exactly how the rewrite module will look and work. The gist of the new setup, though, is that Magento now pulls rewrites from enterprise_url_rewrite, and all the other tables you identify are used to rebuild it during the reindexing process. All the releated tables ending in _cl are change logs that are tied to database triggers.

Categories : Magento

Where is my nginx being configured? Changing nginx.conf still brings me to the 'Welcome to nginx' page
when you rewrited the nginx.conf in the folder of source code of nginx and installed it firstly, it will be copied to /usr/local/nginx/conf/nginx.conf (without specially modification of the configure in the folder of source code). But when you do this secondly, the nginx.conf in the folder of source code will be copied to /usr/local/nginx/conf/nginx.conf.defualt,and it usually don't work unless you use nginx -c /usr/local/nginx/conf/nginx.conf.defualt to assign its configure file evertime. There is a line NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf" in your script above,which indicates the configure file clearly. To handle this, I suggest rewrite /usr/local/nginx/conf/nginx.conf (not the one in the folder of source code) instead.

Categories : Nginx

Nginx - Rewriting url to $url.php, and if doesn't exist, rewrite to $url/
Try using try_files: http://wiki.nginx.org/HttpCoreModule#try_files For example (untested): try_files $uri $uri/ /test.php

Categories : Nginx

expose_php not work (nginx)
finally I got it . the reason is about the configure options below is the original configure options ./configure --prefix=/usr/local/php-5.3.26 --with-config-file-path=/usr/local/php-5.3.26/etc/ --enable-fpm --enable-debug --with-openssl --with-pcre-regex --with-zlib --with-bz2 --with-curl=/usr/lib/ --with-readline=/lib --with-libxml-dir=/usr/lib --with-mysql=/usr/local/mysql and I changed to the fowlloing ./configure --prefix=/usr/local/php-5.3.26 --sysconfdir=/usr/local/php-5.3.26/etc/ --with-config-file-path=/usr/local/php-5.3.26/etc/ --with-config-file-scan-dir=/usr/local/php-5.3.26/etc

Categories : PHP

Why doesn't Nginx load balancing balance bandwidth?
It sounds like the configuration is doing exactly what you asked it to do. You configured a proxy on the first server IP, right? So data has to go from the user to the proxy, then to the server, then the reply from the server back to the proxy and then to the user. It's triple because the first server sees three flows (both servers' output from the proxy and the second server's input to the proxy) while the second server sees one (its output to the proxy). It is perfectly balancing the traffic into equal flows, the first server just sees three flows and the second just one. As for how you fix it, it depends what's wrong with it and what you're trying to accomplish, which you haven't told us.

Categories : Nginx

Nginx no longer starts and doesn't give output
You seem to have a problem here: #server { listen 80 default; server_name anything; # Everything is a 404 location / { return 404; } } server is commented out, but the other lines in that set are not. If you intended on commenting out the entire server block, you'll need to use: #server { # listen 80 default; # server_name anything; # # Everything is a 404 # location / { # return 404; # } #}

Categories : Ruby On Rails

nginx: error_page dont work with rewrite
Please take a look at the directive recursive_error_pages, and it works for me. And kudos to Jim D.

Categories : Nginx

Nginx auth_basic and rewrite in subdirectory does not work
Use: error_page 404 =200 /my-project/index.php; instead of ugly rewrites: if (-f $request_filename) { break; } rewrite ^(.*)$ /my-project/index.php last; Reference: http://nginx.org/r/error_page http://wiki.nginx.org/IfIsEvil http://wiki.nginx.org/Pitfalls P.S. try_files doesn't work with alias because of bug: http://trac.nginx.org/nginx/ticket/97, but you can replace alias with root directive: http://nginx.org/r/root

Categories : Nginx

Have you managed to make your node nginx proxy setup on Heroku work?
This article contains instructions on setting up nginx as a proxy on Heroku, in conjunction with OpenResty, Lua, and LuaRocks. node.js isn't mentioned. It uses this buildpack. Haven't tried it myself but seems someone has got it working.

Categories : Node Js

Mongodb replica set auto reconect don't work after down and up for nginx + uwsgi with several processes
After a change in your replica set (no primary, new primary, etc.), the next operation will throw an AutoReconnect exception. After that one failed operation, the underlying PyMongo MongoReplicaSetClient will reconnect to the replica set, and future operations may succeed. If there is a new primary, MongoReplicaSetClient will find it and future operations will succeed. If there is no primary, no operations can succeed unless you set your ReadPreference to PRIMARY_PREFERRED. See the docs here: http://mongoengine-odm.readthedocs.org/en/latest/guide/connecting.html#replicasets The reconnection process must happen once per uwsgi process. So if there is a change to your replica set, you can expect one AutoReconnect exception per uwsgi process.

Categories : Python

RESTORE DATABASE doesn't work, and doesn't report any error
I think restore sometimes doesn't happen because the database being replaced is in use at that time. Try adding this before RESTORE DATABASE command: ALTER DATABASE [TestMLS] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;

Categories : Sql Server

main program work good , but when put it into a function doesn't work pyQt
You aren't seeing any windows in the class based version because the function calls finalise and your PyQt objects are being garbage collected. In the simple first case you have, the variables containing your PyQt objects remain in scope for the duration. In this simple case, the easiest way to see this in action is store your PyQt objects in instance variables, ie. self.Frame and self.MainWindow to retain references to the object so that Python doesn't garbage collect them. Generally you would not work with PyQt in this fashion. You subclass the relevant object and do setup in the initialiser.

Categories : Python

Why shellcodes with jmp instruction work, and why doesn't the labels work inside a C wrapper?
The address of mesg can vary depending on how your program is laid out in memory. The following will hard-code a specific address and will not work reliably (or at all): mov ecx, mesg For reference, the first approach hard-codes the following address: mov ecx, 0x804807d The second approach does work because it figures out the address of mesg at runtime, using the return address of a call instruction. Put another way, the first version only works if loaded at a specific address whereas the second is position-independent. It is worth noting that the jmp and the call instructions that appear in the second version use relative addressing, meaning that the opcodes specify the distance to the target rather than the address of the target. This makes these instructions work regard

Categories : Assembly

Same url, work like reference to style, but doesn't work like AJAX call
The simplest answer will be to use a local web server like WAMP(or IIS) if you are not already. the second answer is Chrome and Safari has a restriction on using ajax with local resources. That's why it's throwing an error like Origin null is not allowed by Access-Control-Allow-Origin. Solution: Use firefox or upload your data to a temporary server. If you still want to use Chrome, start it with the below option; --allow-file-access-from-files More info how to add the above parameter to your Chrome: Right click the Chrome icon on your task bar, right click the Google Chrome on the pop-up window and click properties and add the above parameter inside the Target textbox under Shortcut tab. It will like as below; C:UsersXXX_USERAppDataLocalGoogleChromeApplicationchrome.exe --al

Categories : CSS

.htaccess redirect doesn't work on first load, but does work on refresh
Your rule is fine. It redirects for me in every browser. What's probably happening is that when you click on the link, your browser brings up a cached copy of the PDF. But when you explicitly reload the page, it sends the request to the server instead of pulling up a cached copy of the page and you see the redirect. If you want to test it again, clear your chrome cache and hit the link again.

Categories : Htaccess

Why doesn't a DOM2"click" event work, when it does work for "mouseover"?
As far as i can tell the link <a id="workID" href="#">WORK</a> is not bound to a click event handler. In the screenshot you can see that you have set several events, but on click is not set. In your main.js you are calling the function showWorkPane() but in this function you define no event handler for onClick: function showWorkPane() { var workID = document.getElementById("workID"); workID.addEventListener("mouseover", showWorkPaneHandler, false); // add an event handler for click } To address your question: Why doesn't a DOM2“click” event work, when it does work for “mouseover”? Well you have to bind both events (click and mouseover). And currently i am looking into your code and it looks like that the eventhandler onmouseout which fires hideWorkP

Categories : Javascript

301 Redirect/Rewrites with Patterns
Use a RedirectMatch instead: RedirectMatch 301 ^/collection/([^/-]+)-active/(.*)$ /collection/active/$2 Assuming by the "is the changed part", you mean there could be anything where it says "womens-". EDIT: Since it's the other way around, just swap the regex grouping and the "womens-": RedirectMatch 301 ^/collection/womens-([^/-]+)/(.*)$ /collection/$1/$2

Categories : Regex

Why Apache mod_rewrite rewrites twice my URL?
Well, I finally solved this issue using a workaround. First I tried these solutions, but subrequests were performed again and again and rewriting failed as before. With mod_rewrite, there are small differences if you put a rule in .htaccess or in global configuration (httpd.conf, Virtualhost configuration, etc.). Subrequests are one of that differences. Just place the same rule I mentioned above in Virtualhost config file instead of .htaccess and subqueries stop and everything starts working like a charm. I recommend this useful post to fully understand the internals of mod_rewrite before trying to solve any related to it issue: http://net.tutsplus.com/tutorials/other/a-deeper-look-at-mod_rewrite-for-apache/

Categories : Apache

IIS 7 aliases/rewrites between two applications
Like Lex said in IIS.NET since the request doesn't ever reach IIS you cannot modifyupdate it in anyway. However, have you considered setting up a separate virtual directory or application within IIS named (app1alias) that just points to this location (app1) ?

Categories : Asp Net

Why doesn't CGContextShowGlyphsAtPositions() work, when CGContextShowGlyphsAtPoint() does work?
One possibility is this, from the CGContextShowGlyphsAtPositions document: The position of each glyph is specified in text space, and, as a consequence, is transformed through the text matrix to user space. The text matrix is a separate property of the context, distinct from the graphics state's current transformation matrix. It doesn't say that about CGContextShowGlyphsAtPoint: This function displays an array of glyphs at the specified position in the user space. (Emphasis added to both quotes.) So, your text matrix is not actually used when you show glyphs from a single point. But then, when you show glyphs at an array of positions, it is used, and you see the symptom of a wrong matrix. Specifically, your matrix to try to flip the text back the other way is wrong: it flips

Categories : Osx

Why does "except" work in filtering out IDs/rows, but "not in" doesn't work?
Would this be what you are trying to accomplish Select pm.patient_id from PatientMedication pm Where (pm.medicine_id = 11 or pm.medicine_id = 29) AND pm.start_date >= '2009-03-17'

Categories : Sql Server

Restarting nginx: nginx: [alert] Unable to start the Phusion Passenger watchdog because its executable
Passenger takes what you set in the file nginx.conf by passenger_ruby, for example: passenger_root /home/dev/.rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.5; passenger_ruby /home/dev/.rvm/wrappers/ruby-1.9.3-p448/ruby;

Categories : Ruby

url rewrites removing folders .htaccess
The problem should be on the last rule: what you need is a negative look behind ie anything not preceede with articles/artificial The regex should be: ((?<!(articles/artificial)).*) But this probabilly does not work since the .* is variable length (see regex look arrounds) A solution could be replacing the negative look behind with a positive look ahead that allows for variable length. So your rule could be: RewriteRule ^(?!.*?articles/artificial.*?)(.*)$ /articles/artificial/$1

Categories : PHP

NSMutableArray addOject rewrites data
This is not an overwrite of a previously added object - the reason you see this is that you have added a reference to the same object two times. Your NSMutableArray looks like this: [_singleBtn, _singleBtn] NSMutableArray does not make copies of objects that you insert, so you need to take care of making new objects before inserting them. One way of making a copy is passing _singleBtn to a method that copies it into a new dictionary, like this: [_buttonArray addObject:[NSMutableDictionary dictionaryWithDictionary:_singleBtn]];

Categories : Iphone

Can a server run Nginx for some sites and Apache Nginx Reverse Proxy for others?
server { server_name example.com; location / { # assuming apache is on port 81 for example proxy_pass http://127.0.0.1:81; # to make apache detect the host header proxy_set_header Host $host; } # if you have assets folders, you can let nginx serve them directly, # instead of passing them to apache location /images { # or /css or /js .. etc try_files $uri =404; } } Note: in the case of assets, sometimes some sites serve assets through rewrites, or even handled by the application it self, you can pass it to apache by adding that in the assets location as a fallback like this location /images { try_files $uri @apache; } location @apache { proxy_pass http://127.0.0.1:81; } In apache you create a virtual host <Virtua

Categories : Apache

CouchDB: Trouble querying a view with a key using rewrites
It's likely that the rewriter is querying zip?key=":zip" rather than zip?key=:zip. You can use a formats field in your rewriter to name how different arguments should be typed. In this case, try this: { from: "/zip/:zip", to: "_view/zip", query: {"key": ":zip"}, formats: { "zip": "int" } } Alternatively, in your map function, emit a string as the ID rather than a number, like this: function (doc) { if(doc.type == 'zip') { emit(String(doc.zip_code), doc) } } That will handle cases where the zipcode isn't an integer, like in the UK.

Categories : Misc

multiple internal rewrites not working as expected
You need to check that the html exists before you apply the rule. You can do this with a condition: RewriteEngine On # extract the pathname into a capture group RewriteCond %{REQUEST_URI} ^/(.*?)/?$ # test to see if the pathname + .html exists as a file RewriteCond %{DOCUMENT_ROOT}%1.html -f # if both conditions are true, apply the rule: RewriteRule ^(.*?)/?$ $1.html [L]

Categories : Apache

My one-line-rewriter only rewrites part of a script
It is possible that you are having the problem because of mixed newline types: Try this: from sys import argv script, input_file = argv def make_one_line(f): uncommented_lines = (line.rstrip(' ').split('#')[0] for line in f) # return ';'.join(uncommented_lines) #print "This will rewrite the file, press CTRL-C to cancel." #raw_input('Press any key (but CTRL-C) to continue.') current_file = open(input_file, 'rU') # Open in universal newline mode final = make_one_line(current_file) current_file.close() outfile = open("out_"+input_file, "wt") # Save the output in a new file outfile.write(final) outfile.write(' ') outfile.close()

Categories : Python

Apache .hatccess rewrites not working for legacy URLS
The first thing is the stray RewriteCond %{HTTPS} !=on that you have at the top. It looks like it belongs to the rule under it, as in: RewriteCond %{HTTPS} !=on RewriteCond %{HTTP_HOST} !^www..+$ [NC] RewriteCond %{HTTP_HOST} (.+)$ [NC] RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L] As far as the rule that you have commented that doesn't work, the ? is a reserved character for regular expressions, and your pattern actually says that the second p in /index.php is "optional". Additionally, you can't match against the query string in a rewrite rule, you need to use a rewrite condition and match against the %{QUERY_STRING} variable: RewriteCond %{QUERY_STRING} ^option=com_chronocontact&Itemid=54$ RewriteRule ^(index.php)?$ /contact/? [R=301,L] is probably more along the lines of what

Categories : Apache

.htaccess rewrite rule to prevent image url rewrites
RewriteEngine on RewriteBase / RewriteCond img/_product/$1/$1A.jpg !-f RewriteRule ([0-9]+)/(.*)$ user/product.php?id=$1 [PT,L] Perhaps that will help. Fixed.

Categories : Htaccess

Does storing URL rewrites in a separate file override manual entries?
Well after much consternation and research, I stumbled upon this question and the highest voted answer, and it's working for me now with the rewrite rule still in rewritemaps.config. Changing {REQUEST_URI} to {PATH_INFO}

Categories : Asp Net

Wordpress subdomain integrated with existing website rewrites urls
In my case, it was a weird thing. If I had a post called "Foo bar", the page example.com/foo-bar worked. If I deleted the post, the page didn't work anymore. So my "solution" was to add articles that were named like my URLs... and hide them somewhere.

Categories : PHP

Media Query width-based CSS not rendered after AJAX rewrites some content
You would want max-device-width as the browser is changing the current width to match the content (leading to scrolling or scaling and no longer matching your media rule.) Take a look at: What is the difference between max-device-width and max-width for mobile web? EDIT: Here is a much better link on more options and iphone specific oddities: http://www.quirksmode.org/blog/archives/2010/09/combining_meta.html I also made a little detector to get at the actual numbers: http://jsfiddle.net/JztA4/2/ <html> <head> <script> var s = ""; for (var i = 0; i < 4096; i++) { var dev = i % 2 ? "device-" : ""; s += " @media all and ( min-" + dev + "width:" + i / 2 + "px) { #" + dev + "width:before { content:'" + Math.floor(i / 2) +

Categories : CSS

LESS really doesn't work
You can try the following workaround - start your .less file with valid CSS code, for example h1 {} and below put your LESS code: @color: #25d14d; h1 { color: @color; } I've faced the same problem and that helped me unexpectedly.

Categories : Visual Studio 2012

Why doesn't ng-if work?
I confirmed the comment on angular's documentation about using the unstable branch by creating this fiddle: <!DOCTYPE html> <html class="no-js" ng-app> <head> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0rc1/angular.min.js"></script> </head> <body> <p ng-if="1 == 0">True</p> {{1==0}} </html> here's the fiddle Running this fiddle results in the output you were expecting. Your code, but with the unstable build.

Categories : Angularjs

Why doesn't my map work in IE8?
ArcGIS API for Javascript run at IE 8 and dojo run at IE 8 but there is a javascript code not run directly in IE 8 as Chrome and firefox you must write javascript code correctly to run at IE 8 and IE 8 can`t run this code : dojo.byId('details').innerHTML = content; this link help you to write correct code to run at IE 8 http://msdn.microsoft.com/en-us/library/ie/ms533897(v=vs.85).aspx

Categories : Javascript

Drawing doesn't work
You have to add the lineDraw shape to the stage. Otherwise, you are just drawing to a buffer. function onLoad():void { var lineDraw:Shape = new Shape(); lineDraw.graphics.lineStyle(3, 0x0000FF); lineDraw.graphics.moveTo(100, 100); lineDraw.graphics.lineTo(200, 200); addChild(lineDraw); trace("test"); } onLoad(); source: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Shape.html

Categories : Actionscript



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.