apache

.htaccess mod_rewrite on root directory but need it to skip all other directories

Here is the directory outline: / /css /js /admin /config /etc... So this is what I would like: / <-- Mod re-write for this directory only, skip the rest /css /js /admin /config /etc... .htaccess file: # Turn rewrite engine on RewriteEngine On # Set the base path RewriteBase / # now the rewriting rules Rew...

C# Messaging implementation similar to Apache Camel

Hi, Does anybody know if their is a open or even closed source c# messaging framework, perhaps based on wcf, which is similar in nature to Apache Cambel. I like Camel as it implemented a nice lightweight modern messageing framework based on the Enterprise Integration patterns by Gregor Hohpe and Bobby Woolf. Pretty much everything I ne...

Running mutliple websites locally Apache PHP Ubuntu

Hi, I am attempting to run more than one virtualhost(?), for example: http:/localhost will point to one project, http:/newsite to another and http:/myfavourite again to a different project a different document root. (each http:// is http:/ here because of hyperlink posting restrictions) I have had no success looking where to edit the ...

How to change the BaseUrl on a Hudson behind a Proxy?

How can i change the BaseUrl on a Hudson behind a Proxy? I'm running a Hudson installation behind a proxy. The problem is, that any url (email, jabber, tray app) in the web application is set to the local proxy and not to the virtual host. How can i fix that, is there any environment variable? I have just found "Hudson Url" for email'...

How to create a 301 redirect based on a query string within a subfolder?

I have a .htaccess file in the root of a website: /var/www/mywebsite/htdocs/.htacess and I have some files in /var/www/mywebsite/htdocs/folder/ which are currently generated by index.php?pc=1234 I want to redirect the numbers in the query string variable to static html pages within that folder. I can achieve this in the .htacess f...

Content-Length header always zero

I set a header in the following way: header('Content-Length: ' . filesize($strPath)); On my PC with ZendServer it works fine and I can download a file with the correct file size. On the production server, a Solaris with Apache and compiled PHP, I get a file with the file size equal to zero, so an empty file. Is there a config paramet...

How do you combine these 2 .htaccess RewriteRules into one?

Ok I have another question and I'm a beginner at this. I have this RewriteRule, it redirects the query correctly but doesn't allow me to use the other directories: RewriteRule ^([0-9A-Za-z]+)/?$ /query.php?id=$1 [L] and now this RewriteRule to skip all these directories but now the rule above needs to be commented out for this to wor...

Htaccess Querystring rewrite

I have URLs like /?test that I want to rewrite to /page.php?page=test I tried like this but for some reason it doesn't work. RewriteRule ^\?([a-z0-9\-\+]{3,20})/?$ /page.php?page=$1 [NC,QSA] What am I doing wrong? ...

Updating Files on Apache

I'm having trouble with my Apache Web Server. I have a folder (htdocs\images) where I have a number of images already in place. I can browse them and see them on my web server (and access them via HTML). I added a new image in there today, and went to browse to it, and it can't be found. I double and triple checked the path and every...

Rewrite rule for "site down" pages

I was trying to install this .htaccess to notify my users of site maintenance. It seems the first [L] isn't working and the second rewrite is doing everything. How do you guys do site maintenance messages? RewriteEngine on RewriteRule ^s/down$ index.html [L] RewriteRule ^(.*)$ http://metaward.com/s/down [R=302,L] ...

Share Python Interpreter in Apache Prefork / WSGI

I am attempting to run a Python application within Apache (prefork) with WSGI in such a way that a single Python interpreter will be used. This is necessary since the application uses thread synchronization to prevent race conditions from occurring. Since Apache prefork spawns multiple processes, the code winds up not being shared betwee...

Secure static media access in a Django site

I'm building a site where registered users can upload files. Those files are then served via Apache. Only users who are logged in should be able to access those files. I have read this page but it seems that people would have to log in twice to access both the site and the media, each time using a different type of login box. Is there ...

htaccess rewrite rules

Hello, I've currently got a web application that I need optimizing, and one of methods or something I'm trying to achieve is such: http://myweb/dept/app from http://myweb/?dept=dept&amp;app=app I've currently this as the PHP code for it: if(empty($_REQUEST['dept'])) { $folder = "apps/"; } else { $folder = str_replace("/"...

mod_rewrite: setting GET depending on HTTP_HOST

Hi guys, I recently discovered the power of the mod_rewrite module and I need some help with it. Say I have a website which has two domain names mapping to the same host... example.com example.net And I would like to set a GET var depending on the the HTTP_HOST (i.e. .com OR .net ?) ... /index.php?lang=en /index.php?lang=es Howev...

What to expect and prepare for when moving from LAMP to SAMP

My company has a very real problem with patch management on our web servers. The public servers are out of date, and now management considers this a priority. However, rather than simply updating and patching the existing servers (and all the testing that goes along with that) they have embarked on the process of migration to Solaris s...

Rewrite to a new domain? with url query? not working. :( help

I have this rewrite rule... Redirect all initial request from world.example.com to web.example.com RewriteCond %{HTTP_HOST} ^world\.example\.com$ [NC] RewriteCond %{HTTP_HOST} !^$ RewriteCond %{SERVER_PORT} !^80$ RewriteRule ^(.*)$ https://web.example.com$1 [R=301,L] Which works great. But, some of my applications has... https://wor...

Apache Mod Rewrite - Replace : character with another

I'm trying to rewrite all URL's that contain a ':' in it to another character. http://en.wikipedia.org/wiki/Filename#Reserved%5Fcharacters%5Fand%5Fwords Example: http://example.com/some_interesting:info http://example.com/some_interesting_info http://example.com/some:interesting:info http://example.com/some:interesting_info would al...

Solving trailing slash problem for a given setup

Hello, Considering the following rules, how can I rewrite them in order have a trailing slash? I have to mention that I can only edit the .htaccess file, so I have no access to modify the URLs in the website. RewriteRule ^artists/(.*)-p(.*)$ /artists.php?l=$1&p=$2 [QSA,L] RewriteRule ^artists/(.*)$ /artists.php?l=$1 [QSA,L] RewriteRu...

RewriteRule on special querystring

My URLS the page names example: ?Contact- or ?Product- some have a longer querystring example: ?Contact-&go=Admin domain.com/?Contact-&go=Admin I would like a RewriteRule to use domain.com/Contact/Admin thanks ...

rewrite urls with GET reqs

Hello, how do I configure my .htaccess rewrite rules to accomodate GET requests? Currently, /manager/page goes to: ?dept=manager&n=page however, some pages have additional GET reqs, and so this rule doesn't work: RewriteRule ^([A-Za-z]+)/([A-Za-z]+)$ index.php?dept=$1&n=$2 [QSA] I would need: ?dept=manager&n=page&id&etc=etc to go to:...