apache

Apache Rewrite Override Mime and Proxy Request?

I am trying to implement some Apache rewrite rules to set the MIME type (in)correctly for XHTML in Internet Explorer. I have found these rewrite rules in many place, and they seem to work for most people: RewriteCond %{HTTP_USER_AGENT} .*MSIE.* RewriteRule .* - [T=text/html] However, my site is already using Rewrite rules with the...

Parse DS_Store w/ PHP

Ok, I know this is a longshot, but I'm going to ask anyway... I develop web applications locally on my computer and use the normal Apache directory index to navigate amongst the directories of project. When I am in Finder, I label certain directories with color labels to highlight what is current. Wondering if there is a way to determi...

Is it better to handle friendly/clean/pretty URLs with mod_rewrite or a language like PHP?

I'm developing my first decent-sized PHP site, and I'm a bit confused about what the "right way" (assuming there ever is such a thing) to handle clean/friendly/pretty URLs in the application. The way I see it, there are two main options (I'll use a simplified social news site as an example): 1. Use mod_rewrite to handle all potential U...

sub-domain directory redirection using htaccess

I am trying to redirect something like this sub-domain.domain.com/directory to domain.com/directory I tried Redirect 301 / domain.com/directory [htaccess file placed in sub-domain] it works fine for the sub-domain but won't work for the directory within the sub-domain. Can somebody help me with what should be the content of .htacc...

Writing a web-scripting language from the ground up?

I'm looking for references stating how to write a web scripting language and interface it with a web-server. I'm not looking for "how to write the language" or "how to write an interpreter" references rather - I don't know how the basics of a web-script interpreter work? Is it a simply a CGI based interpreter that is passed the HTTP pa...

XAMPP Apache server not working on internal network

I have XAMPP installed on my local laptop (Vista) and it works fine. Apache and MySQL are running as services, and I can get to both http://localhost/ and http://192.168.2.2/ without any hassles. However, if I try accessing the server from another laptop on my internal network by typing in the http://192.168.2.2/ ip address, it errorsti...

How to use Kerberos authentication with a Mac web server

I'm trying to do some development work that involves authentication at home on my Mac. I've got a full domain set up here with my mac joined to it. Unfortunately, it seems like mod_auth_kerb is non-existent for the Mac platform. I tried compiling from source, but I get a bunch of warnings that don't really make sense and the compilation ...

PHP Kohana CentOS 5

Trying to deploy a Kohana based project in CentOS 5. Installed PHP 5.3.1 but still getting the following error. Warning: preg_match() [function.preg-match]: Compilation failed: this version of PCRE is not compiled with PCRE_UTF8 support at offset 0 in /usr/local/apache2/htdocs/icarus/system/core/utf8.php on line 30 Fatal error: PCRE ha...

htaccess Redirect to same file, but display different URL without having to change internal links?

I currently have links on my website in the form of:- http://example.com/products.php?cat=X I want that once taken to the destination of the link, the url displays something like:- http://example.com/new. The file on my server is the same file, but only the url should appear neater without me having to change any of the links. I tri...

mod_rewrite loops even with L flag

I've got a problem with rewriting a URL to a fastcgi dispatcher. If I leave only: RewriteRule ^(.*)$ dispatch.fcgi/$1 [L,QSA] I expected L (last rule) to cause only a single rewrite. Instead, it keeps prepending dispatch.fcgi until apache reports an error. I know it can be fixed with: RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ...

Apache RewriteCond from result of php request

I would like to add a rewrite Condition in my htaccess that would be true if calling a php file returns "true" or false otherwise. I' am using the -U switch in my RewriteCond to run a subrequest and if the condition is not satisfied, the PHP script returns a 404 error, which triggers the rewriteCond. My goal is to run a URL shortening s...

How to make a web directory with Desciption Field?

I want to know how to you make web directory like this http://www.ibiblio.org/pub/docs/ It has a description field for each file ...

Mod_ReWrite / ReWriteMap a URL using a database lookup script

The Scenario I have completely rewritten an old existing ASP classic ecommerce website over to PHP. The database design of the previous site had alot of relational ID problems causing troublesome linking of product data rows to other tables in the database. To get around this I also redesigned the database, giving products new Primary ...

Using same .htaccess in different environments

From development to testing to production our website resides in three different environments http: //localhost/version/ http: //www.production.com/test/ http: //www.production.com/ (see examples of URLs in the following .htaccess snippet) Options +FollowSymlinks RewriteEngine on RewriteRule ^brand/(.+) /products.php?brand=$1 [R,NC]...

.htaccess Rewrite URL images not showing - directory confusion.

Okay so I'm rewriting a URL domain.com/id/text to domain.com/page.php?id=id using mod_rewrite / htaccess Options +FollowSymlinks RewriteEngine on RewriteCond %{http_host} ^webresauce.com [nc] RewriteRule ^(.*)$ http://www.webresauce.com/$1 [r=301,nc] # Rewite URL Starts here RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FIL...

Using Python like PHP in Apache/Windows

I understand that I should use mod_wsgi to run Python, and I have been trying to get that set up, but I'm confused about it: This is a sample configuration I found for web.py: LoadModule wsgi_module modules/mod_wsgi.so WSGIScriptAlias /appname /var/www/webpy-app/code.py/ Alias /appname/static /var/www/webpy-app/static/ AddType text/h...

How to properly set up svn on web server?

I have found this question but it was never resolved and don't want to hijack it for myself. I'll try and give as many details as possible. I have a shared hosting account on a linux server which is my web server and I have shell access. I'm working from a windows machine using tortoise svn. I have several web sites in my public_html/...

Redirect all page on a domain to one file

Hello, I am looking to permanently redirect all the pages on a domain to one page on the SAME domain, using htaccess/mod_rewrite. Basically I want any page requested for the domain to return a holding page [ which is index.php] at domain.com/ most of my attempts so far are causing errors as they are throwing the server intoa loop. T...

Login form to an a secured app in tomcat

I have a normal HTML page in a normal Apache http server (http://yyy.yyy.yyy.yyy/index.html ), with an authentication form, with that form I need to access with the credentials to an application located in other server with diferent IP , that server have a secured application with tomcat: here is the login form in the apache http server:...

Migrating from Apache to lighttpd?

There are many threads here weighing the various merits of Apache and lighttpd. However, no one has talked about tools for migrating from the former to the latter. Are there good tools for the task? I have a bunch of random .htaccess tweaks in directories around a site, I want to find them and make sure those are either converted cleanly...