apache

Apache / htaccess rewrite - From domain to subdomain

Hiya, I'm trying to find out how to edit my htaccess to push all requests for files in: http://www.domain.com/images to head off to: http://cdn.domain.com/images The reasoning being i'd like to parrelise http requests over a number of domains/subdomains to speed up page load. Is this possible through apache scripting, or will I hav...

Using MOD Rewrite to rewrite user requests only

Hi I use this: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?action=$1 [QSA,L] Which works as it is supposed to (makes www.example.com/something redirect to : index.php?action=something). I want to save each request in a DB.So if i insert the $_GET['action'] vari...

mod_rewrite rule to use the CSS from root web folder in a subdomain

My root already has all the css and image files I require www.example.com (my domain) www.example.com/css/style.css (my styles) On my hosting, my sub domain has to live inside a folder root folder public_html/ index.php css/ style.php subdomains/ admin/ .htaccess index.php How can I use mod...

Do I need to send a 404?

We're in the middle of writing a lot of URL rewrite code that would basically take ourdomain.com/SomeTag and some something dynamic to figure out what to display. Now if the Tag doesn't exist in our system, we're gonna display some information helping them finding what they were looking for. And now the question came up, do we need to...

Trying to put an exception to RewriteRule in .htaccess

I am redirecting all requests like so: RewriteRule ^sitemap.xml$ sitemap.php?/ [QSA,L] # the line below is the one I'm having trouble with RewriteCond %{REQUEST_URI} !^market-reports$ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*) /index.php?section=$1 [QSA,L] All my incoming links are mea...

im confused with apache vhost

Hi, I am building a web application with Zend Framework, and I need to point my app to the "public" folder of the application: So basically when I call http://localhost/myapp it should display http://localhost/myapp/public/ I created a virtual host file called myapp into /etc/apache2/sites-available/: <VirtualHost *:80> DocumentR...

robots.txt ignrore all folders but crawl all files in root

hi all should i then do User-agent: * Disallow: / is it as simple as that? or will that not crawl the files in the root either? basically that is what i am after - crawling all the files/pages in the root, but not any of the folders at all or am i going to have to specify each folder explicitly.. ie disallow: /admin disallow: /thi...

Mercurial Server on Apache/Windows

I'm searching for info to setup a Mercurial Server for Windows (7 or XP) with an Apache (xampp if it is useful to know it) with the Push Model, just like in this question but my team is composed of 5 to 8 (unsolvent) guys who are each one working in separated places, so I don't think the bitbucket solution or anyother non-private repo ou...

mod_rewrite with subdomain and url pattern

Hi everyone, I want to use the subdomain as a get variable with mod_rewrite AND use some parameter : eg /page/language/site/counter -> index.php?o=operator&lg=language&s=arg1&c=arg2 How to do that with mod_rewrite? RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.example\.com [NC] RewriteCond %{HTTP_HOST} ^([a-zA-Z]{3,6})\.example...

Serving two websites with Apache with single domain name and single IP address

I am trying to host two websites using Apache from the same Ubuntu server. I have one ip address, and I only have one domain (which resolves to the ip address). So I want requests to the domain name to give one website, and requests to the ip address to give the other. I have symlinks in /etc/apache2/sites-enabled to two files, pointi...

Postfix screwing up email headers!

I've set up a local dev environment on snow leopard, and have set postfix up to send email via my isp mail server. I eventually got postfix to work after much frustration, but now when my emails send the header information is bunged up! I'm using the following php code: $email = "me@mydomain"; $subject = "Email tester"; $body = "Simp...

Sqlite3, apache users, and easy installs

I'm writing a small app that needs to have a super easy install process. Version one used a csv file instead of a database, so priority #1 for v2 is getting sqlite going instead. I've used sqlite a lot with Ruby, and love it, but this is my first time using it with PHP. Basically, in order to get SQlite3 to be able to insert into the db...

Is there a way to make git remember the password for WebDAV remotes?

I'm working with Git pushing changes to a repository shared over HTTP / WebDAV, and Git prompts for a password for every operation that accesses the HTTP remote. Is there any way to make Git cache the password / have the remote server not prompt me? The remote webserver should be an Apache and could possibly be reconfigured if necessary...

Prevent direct access to files with .htaccess

Ok, I am using codeigniter and I have a secure login section. Inside the login users are able to download files. What I need to do is stop people been able to access the file directly. I figure there will be a way using .htaccess to check for a authenticated variable that I could set in the POST array or something similar. Any pointers...

Tomcat fails on first request in combination with jsvc

I have a web application where the first request may take a few seconds as some singletons are initialised. I've used the mod_proxy and jsvc construction mentioned in this question and described on this page to connect apache with tomcat (data is served via SSL) For the sample Tomcat application, everything works as it should. However,...

Apache crashes when php_apc extension is turned on when using symfony?

It's happenning in windows. PHP5.3.0 Apache2.2.11 Symfony 1.4.1 Is there a fix ? [apc-error] Cannot redeclare class sfeventdispatcher in D:\wamp\symfony-1.4.1\lib\event_dispatcher\sfEventDispatcher.php on line 3. [crit] Parent: child process exited with status 2 -- Aborting. ...

Apache mod_perl handler/dispatcher returning control to apache.

Is it possible to have an apache mod_perl handler, which receives all incoming requests and decides based upon a set of rules if this request is something it wants to act upon, and if not, return control to apache which would serve the request as normal? A use-case: A legacy site which uses DirectoryIndex for serving index.html ...

Modrewrite regex

I have the following URL: http://www.domain.com/keyword/b21?f=&amp;ca1=50&amp;p=1 And the RewriteRule I am trying to use is as follows: RewriteRule ^([^.]+)/b([0-9]+)?f=([^.]+)&p=([0-9]+)$ script.php?id=$2&p=$2&filters=$3 Unfortunately this rule is not matching the URL. I think it has something to do with the ? as i know this is a c...

htaccess not working as it should

well, ofcourse its not working, im still a n00b :) this is the code that i have : Options +FollowSymLinks RewriteEngine on RewriteRule (.*)\.css - [S=7] RewriteRule (.*)\.jpg - [S=6] RewriteRule ^gallery gallery.html [L] RewriteRule (.*)/(.*)/ index.html?page=$2 [L] RewriteRule (.*)/(.*) index.html?page=$2 [L] RewriteRule (.*)/ index....

AJP proxy that maps internal servlet name to a different external name

Using apache2 I want to set up an AJP proxy for a Tomcat server that maps an internal servlet URL to a completely different URL externally. Currently I am using the following configurations: Apache2 configuration: <IfModule mod_proxy.c> ProxyPreserveHost on ProxyPass /external_name ajp://192.168.1.30:8009/servlet_name Proxy...