apache

iPhone .htaccess redirect loop

Hi guys, I've a webapp at www.mysite.com/myapp/ and I'd like to redirect users visiting my app from iPhone to www.mysite.com/myapp/i/ using an .htaccess file in /myapp folder. What I've tried so far is: RewriteEngine on RewriteCond %{HTTP_USER_AGENT} iPhone RewriteCond %{REQUEST_URI} !^/myapp/ RewriteRule .* /myapp/i/ [R] It enters a...

apache rewrite htaccess

I've been trying things on my server but I can't figure out what's going wrong. As of now, this is the .htaccess I have: Options +FollowSymlinks RewriteEngine on RewriteRule (.*) $1 [NC, L] Instead of rewriting to 'match' it rewrites to 'match'.php Any idea why? ...

Mysql/Apache connection error from Php script

I am trying to use php. I wrote a small script as instructed in the tutorial. I am using Wampserver 2.0. Connection is fine. But whenever I try to execute the script, I get "Apache HTTP server encountered a problem and needs to close" error message. My localhost is working fine. Normal php scripts without mysql statements in it is workin...

Mod_rewrite .htm to fake subdirectory

I have a website with a CMS that uses mod_rewrite to make URLs look cleaner. Previously, the clean URLs had the extension .htm, but I want to transition this to them appearing as fake subdirectories, IE: http://www.example.com/pagename/ I have two rewrite rules in place to rewrite both the old scheme and the potential new one: Rewrit...

Is it possible to control which libraries apache uses?

Okay, so I had an earlier problem with PIL that is still unresolved. Someone else had this problem and had success by removing the old JPEG library. I can't really do that on my machine, however, as it's RHEL and so many things are dependent on libjpeg and libjpeg-devel (when I tried yum remove libjpeg just to see, there were a total of ...

How to nest a Location directive inside a virtual host config?

I am trying nest a Location directive inside a virtual host config like this: <VirtualHost *:80> ServerName mysite.com DocumentRoot /home/deployer/apps/mysite/current/public ErrorLog /var/log/prod.log <Location "/shop"> DocumentRoot /home/deployer/apps/mysite_shop/current/public ErrorLog /var/lo...

The wrong url is showing up for my site in google searches

Hey folks. I have a client who's old website was called toastkid.com. I set up a new site, alekskrotoski.com, and had the old www.toastkid.com domain point to the new site. I have a 301 redirect working, so when you go to www.toastkid.com the address bar updates to alekskrotoski.com. So, the 301 is definitely working fine. However, ...

What are the minimum hardware requirements for IIS 6.0 and Apache 2.x?

One of the questions on my IT assignments is to provide the minimum hardware requirements for Apache 2.x and IIS 6.0. I know this should be a simple-as-pie question, but for the life of me I can't find any definitive answers after extensive googling..although I'm notorious for overlooking things. If I am to be flamed, please at least p...

Send all traffic a 404 error

What is the best way to send all traffic to your site a 404 page? I'm currently working on the site and would like it to just 404 for all requests. I've tried playing around with htaccess files but haven't been too successful in getting one working like this. Additionally, I would like traffic to a particular folder to still get through....

Htaccess Modify String then Redirect 301

Hi, I'm trying to rewrite the following into htaccess using - redirect 301 redirect "mysite.com/longname/{20 character string}" to "mysite.com/shortname/{10 character string}" basically to redirect the "longname" to "shortname" and cut the "20 character string" to the first 10 characters so when I go to mywebsite.com/longname/aaaaabb...

Apache 2 Administration Tools on Ubuntu or Windows

Hi There... I am totally new to Apache and Ubuntu, is there an admin tools where the available functions and features and settings are more accessible? I am finding it very difficult to do even the simplest things.... please help. Cheers. ...

Django admin authentication failure

Hi folks, logging into django admin fails when 'log in' button is pressed first time, but pressing "back" and "log in' again - logs the user in successfully. I am deploying Django app with zc.buildout here, with a setup similar to what is described here http://www.meppum.com/2009/jan/17/installing-django-ubuntu-intrepid/. Nginx (listen...

How to use mod_Rewrite to check multiple folders for a static file

What are the mod_Rewrite rules for checking multiple folder locations for a given file. For instance, if I have a folder structure of: public/ css/ library1/ css/ library2/ css/ and I want requests to /css/somefile.css to first check the public/css/ directory, then cascade to public/library1/css/ then publ...

How do you use gettext on server (Apache) you can’t restart ?

I asked this question on serverfault but I didn't get any response. I try here... I developped a site on my web server at home. When I modify the translation files, I have to restart the web server Apache. /etc/init.d/httpd graceful Easy... Suppose that my site is hosted on shared host. Suppose now I need to modify the translation ...

Deploy rails app to non-root context - restful_auth not working

I'm running a rails app on http://www.naildrivin5.com/scalatour. It works fine. When I log in to the app using restful_authentication, I get taken to the http://www.naildrivin5.com instead of the app. Weird. This seems like I've misconfigured something. Further, there's a few places where I'm hand-creating some urls, and I need ac...

.htaccess deny access to specific files? more than one

I am able to disable access to a file with .htaccess, but I don't know how to disallow multiple files to be viewed (directly, not from includes) They are .php so I can't disable a file type (like the only tutorials online say..) <FILES ... ? </FILES> Or something.. For example "home.php, file.php , test.php" how do I disallow acces...

Rewrite rule with the exception of static content

My current htaccess file looks like this: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f [NC] RewriteCond %{REQUEST_FILENAME} !-d [NC] RewriteRule ^(.*)$ index.php?page=$1 [L,QSA] This works fine for me, however I want to try and reduce server load so I have added this line just below the RewriteEngine On line to stop processing...

Need to Run ASP.NET application on Apachea

people , i need to run asp.net application on apache, can any body suggest. how too. ...

How do I stop URLs that don't exist from resolving to a file?

I don't know if this is an Apache or PHP thing but if you go to either of: mysite.com/about mysite.com/about/ it will show the mysite.com/about.php file instead of a 404 error, because the directory does not exist. I am sure this is some setting, maybe an htaccess thing, any ideas? ...

Using PHP/Apache to restrict access to static files (html, css, img, etc)

Lets say you have lots of html, css, js, img and etc files within a directory on your server. Normally, any user in internet-land could access those files by simply typing in the full URL like so: http://example.com/static-files/sub/index.html Now, what if you only want authorized users to be able to load those files? For this example, ...