Tag Archives: sed

htaccess Rewrite URL based on TLD

Questions: On my website, I am interested in moving my forums from a subdirectory to a subdomain. The forums are currently located at example.com/forums, and I want to move them to forums.example.com. After the move, I want to use htaccess to 301 redirect all forum traffic to the subdomain, but the problem is that I… Read More »

Python or Jython for Django based application?

Questions: We are going to start developing Django based application. It requires speed optimisation (need to serve k+ requests/sec), n number of nodes with HAproxy and PostgreSQL load-balancing. Presently we consider using Python, Apache, memcached Jython, Glassfish The application should scale overtime, Python or Jython. Any suggestion? Answers: Which language you know better? JVM based… Read More »

SSL based virtual host with django and mod_wsgi

Questions: I have a django web application in which some URLs are allowed to be accessed over http while others have to be over http-secure only. I need to set up the virtualHost/ mod_wsgi configuration in my apache conf file, so that the same web application can be accessed over both. I followed these 2… Read More »

Is it possible to query a database using a value passed in a URL, and write the result of the query to the URL using mod_rewirite?

Questions: Is it possible to use mod_rewrite to write an htaccess rule that takes a url paramater value (for example: id=1, where ‘id’ is the paramater, and ‘1’ is the parameter value), query a database with the parameter value specified, and then write the value returned from the query as a part of the url… Read More »

Speed while searching through a massive Database [closed]

Questions: I’m a database newby. I am wondered about some things in Databases. For example, I saw the structure of how Facebook stores a friend relationship (see : https://developers.facebook.com/docs/reference/fql/friend). There only two columns, 1st users id and the second users id. Well that’s okay. As wikipedia says facebook has around 1 billion active users. So… Read More »

Routing requests through index.php with nginx [closed]

Questions: I’m migrating my server from Apache to Nginx and have this very simple .htaccess rule: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [QSA,L] The idea behind it is to direct every request to a front controller (index.php). I’m trying to do the same with Nginx. I used an online converter to make this… Read More »

jQuery AJAX polling for JSON response, handling based on AJAX result or JSON content

Questions: I’m a novice-to-intermediate JavaScript/jQuery programmer, so concrete/executable examples would be very much appreciated. My project requires using AJAX to poll a URL that returns JSON containing either content to be added to the DOM, or a message { “status” : “pending” } that indicates that the backend is still working on generating a JSON… Read More »

WebKit “Refused to set unsafe header 'content-length'”

Questions: I am trying to implement simple xhr abstraction, and am getting this warning when trying to set the headers for a POST. I think it might have something to do with setting the headers in a separate js file, because when i set them in the <script> tag in the .html file, it worked… Read More »