apache

Web.py URL Mapping not accepting '/'

So every web.py tutorial I've seen includes this line: urls = ( '/', 'index', ) And then, later on, the index class is defined with a GET function and so on. My problem is, this doesn't work. Using the code above, I get a 404 error. Using the following mapping works: urls = ( '/.*', 'index', ) But that's going to catch, at ...

Changing URL structure of a site - correct technique for SEO appraoch - 301 headers?

Ive been making changes to a old site Ive worked on, one of the tasks Ive taken is to change the url structure to something alot more friendly. For example pages currently work via query strings such as ?action=contact and ?action=article&id123. I am now changing them to /contact and /article/articlename respectively. I would just like t...

XSendFile can't stat file if on windows samba share?

Hello, I am having trouble getting apache to serve a file through the XSendFile when it is in a directory mounted with samba. To give a little background: I have a Ruby on Rails app that is slowly replacing an ASP.NET application, and I have it running on a linux server running apache2 and passenger. The Windows machine that is running...

Rewrite for all images AND one particular php filename

As a precaution against hotlinking, I've been using the following rule to redirect people with the wrong referrer to our logo instead of the actual image: #Naughty hotlinkers RewriteCond %{REQUEST_FILENAME} .*jpg$|.*gif$|.*png$ [NC] RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !sitedomain\.com [NC] Rew...

how to compress uploaded data using WebClient C#

I am using WebClient with C# the following code works fine wc = new WebClient(); wc.Headers.Add("Content-Type", "application/x-www-form-urlencoded"); NameValueCollection nvc = new NameValueCollection(); nvc.Add("webdata", JsonConvert.SerializeObject(webdata)); response = wc.UploadValues(@"http://localhost/api/results", "PUT", nvc); Th...

Handling Tomcat Errors Through Apache

I use Tomcat for hosting my web application and use apache http server on top of it using mod proxy for load balancing. When my application throws a 404 or 500 error, I want to serve the error pages through apache http server rather than tomcat server. This is because I am serving all of my static content through apache and we don't wa...

@font-face and Header set Access-Control-Allow-Origin "*"

I have used the following rule to allow our static domain to host fonts, but I've run into a problem font's not being used by the browser (firefox, safari) when the browser cache is enabled. <Directory "/site/http/web/assets/fonts"> <FilesMatch "\.(eot|otf|woff|ttf)$"> SetEnvIf Origin "^http://(.*)?main-domain.co...

Modifying Apache config file using bash script

I'm currently writing a script to automate our CMS setup and deployment. Part of that process is adding an alias to Apache2 which is normally done manually via Webmin. At current, I'm looking to append a line into the Apache2 include file that stores all the alias, using the following: echo Alias /path \"/var/www/directory\" >> alias.i...

Redirect all links below a subdirectory to a "out of service" page?

I have a directory full of email forms in various subdirectories, linked by various people in various places. I recently found a security problem in some of the forms, and I've taken them all offline, but now when people go to the links they get 404 errors. Is there an easy way, with .htaccess perhaps, to redirect any request for mydom...

Kaltura Install on Plesk / Media Temple DV3.5 apachectl error

Hello All, Some pain today as with everything new and exciting. I am attempting to install Kaltura CE on a subdomain on my Media Temple DV runnning plesk 8.6.0. I get to a step that asks for my apachectl path and I enter correctly but keep getting errors as listed below. I do know this is meant to be on a dedicated box but as with ev...

Is apr_pool_destroy() of apache thread safe ?

Hi, My application is built with apache and runs on windows. I am creating a Thread using the createThread() and then for each thread executing the below : ap_run_sub_req( subrequest ); ap_rflush( subrequest ); ap_destroy_sub_req( subrequest ); The ap_destroy_sub_request in turn calls apr_pool_destroy() function. The ap_run_...

how to make apache restart gracefully in windows when not running as a service

I have apache running as a child of a process, how can i tell it to restart gracefully, or stop gracefully (without killing current connections...) -- or how to make apache act like in restart (re-read configuration, close and open threads...) ...

how can i redirect via htaccess

hi guys, i want to redirect http://abc.com/a to /mypage.php?par1=a and http://abc.com/a/b to /mypage.php?par1=a&par2=b how can it be done? ...

Apache mod_rewrite - How to hide $_GET vars from url

When I call the page http://localhost/books-123-name.html?language_id=1 to appear in the browser the following link: http://localhost/books-123-name.html but will keep the value language_id=1 How can this be done? Thanks. ...

Help dealing with .htaccess for making my URL pretty.

Hi, My current URL look like this. http://example.com/news.php?id=25&amp;cat=news&amp;date=01092010&amp;title=this-is-the-first-title i want to make it cleaner like http://example.com/news/01092010/this-is-the-first-title i just know the basic of how .htaccess works with the basic understanding of its directive, how do i a...

Add expires header without mod_expires?

I know that I can add expires header using mod_expires. However, what can I do if the Apache server doesn't have mod_expires installed and I don't want to route the access to the files through a scripting language like PHP? ...

Forcing a trailing slash to a URL after a subdomain rewrite

Hi There, I'm re-writing a subdomain to a 'folder' - actually a page in wordpress, and this all seems to be working correctly. I don't want the address in the URL bar to change though. Everything works fine unless the user does not put a trailing slash after the page name, then the page is still redirected to the correct URL but the U...

Flipping a REQUEST_URI with ! in httpd.conf

Hi. I'm trying to set up a simple rule in my httpd.conf as a precursor to some more complex rules I need to set up. If I use this: RewriteCond %{REQUEST_URI} ^/test\.txt RewriteRule ^(.*)$ http://127.0.0.1:8080 [R,L] ... then a request for /test.txt goes to port 8080, as expected. But if I add a ! to flip the REQUEST_URI match, like...

How can I add PostgreSQL support in PHP bundled in XAMPP?

Apache: v.2.2.14 PHP: 5.3.1 PostgreSQL: 8.4 XAMPP: version 1.7.3 ...

Specific web page started to occasionally result in 500 internal error

Hi, I've come across an issue today where a specific page on my site is sometimes causing a 500 internal error. The page normally can take fairly long to load due to some database queries on large datasets, but only today has the apache 500 internal error started to happen. Obviously I will try to optimise the db queries as much as possi...