.htaccess

htaccess (no redirection) [REWRITEURL] (folder to index.php)

hi there people. I just want to get a quick htaccess redirection. ie: domain.com/subfolderGreen --> domain.com/index.php?folder=subfolderGreen (note that the subfolderGreen actually exists) I've been trying but couldn't get to the regex needed. thanks. a. ADDED: Sorry, i want this to work for any subfolder, not just "subfolderGree...

mod_rewrite : why does it work locally and not online ?

I'm developing an app locally (under Domain name <mydomain>.dev). In order to work with friendly urls, i've set up my .htaccess like this: RewriteEngine on # Externally redirect to add missing trailing slash RewriteRule ^(([a-z0-9._\-]+/)*[a-z0-9_\-]+)$ http://example.com/$1/?%{QUERY_STRING}[NC,R,L] RewriteRule ^about/$ about.php [NC,L...

.htaccess file modification

Hello, I have a .htaccess file which arranges that all requests go through index.php. Now i would like to make an exception for rss.php. to go straight throuh rss.php. How do I do this? This is how it looks like now: RewriteEngine on RewriteBase / RewriteRule !\.(js|ico|txt|gif|jpg|png|css)$ index.php Thanks. ...

re-direct / re-write my domain

firstly, i have already spents the past few hours trying to find a solution for this, but have had nothing but non-working solutions :( it's pretty simple - i'm pointing the DNS of a new domain to my current hosting. but when i visit the new domain, i'm just viewing my original site (the one i got with my hosting). let's say my origina...

htaccess redirect old site to 2 different domains

ok so heres the scenario: i got a blog on the root directory of my host then i hosted some app on a subfolder named fsGallery. now, i bought a new domain for my blog and another domain for my app. ii would like to know the proper htaccess 301 redirects in order for me to redirect the old directories to their respective new domains here...

htaccess trouble

I have this .htaccess file, which is not working, when I navegate to gotgage.local/category/gages/ the gages portion of this is not being passed RewriteEngine On RewriteRule ^/category/(.*?)/$ category.php?p=$1 [rn] For the sake of testing the category.php file is just dumping $_POST, $_GET and $_SERVER this is what I am seeing when ...

.htaccess clashing with GET params

Here's my .htaccess file: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule .* ?p=$0 Which should redirect to mysite.com/?p=request only if request is not a file. But, it's improperly matching a request like http://mysite.com/auth.php?openid.ns=http%3A%2F because of the %2F (auth.php...

How to I stop an infinite redirect loop?

Hi, I have a blog that has a redirect loop, and I can't understand htaccess too well right now (late, and needs to be done by the AM) so am hoping for a quick fix. The site is throwing 301s from xxxxx.org to xxxxx.org/index.php, and back to the beginning. The htaccess file is as follows: # BEGIN WordPress <IfModule mod_rewrite.c> Rewri...

htaccess file restriction

I have a directory on my webserver. It does not have an index page. so when u access the directory via a web browser it lists the files in it. Now i want to create a htaccess file that can block the directory listing so that when you access it via the web browser, the files in the directory would not be listed but would be able to access...

.htaccess not working - only caching images and not JS or CSS

Duplicate: Why isn’t my javascript & css caching ? I'm noticing that I'm only receiving 304 HTTP codes (cached content) for images but not JavaScript or CSS. My .htaccess file is: Options -Indexes Options +FollowSymLinks # Enable ETag FileETag MTime Size # Set expiration header ExpiresActive on ExpiresDefault "access plus 1 w...

Why isn't my javascript & css caching ?

It's appears ONLY javascript and css are not caching ... but images are caching. I am using Firebug and when I refresh the page, I notice in Firebug a lot of 200 HTTP responses for js/css but am receiving 304 HTTP codes (content not modified) for all of my images. So it appears that my JS and CSS are not caching. Also, when using YSlow...

.htaccess and rewrite of URL

We have the following example "ugly" URL: https://some.uglyurl.com/directory/test.jsp?hotelid=1111&amp;rateplanid=33333 we need to direct our customers to the above URL using our own domains URL as the address - so it would look something like: https://www.PrettyURL.com/reservations?hotelid=1111&amp;rateplanid=33333 The idea being ...

conf or .htaccess-- when to use which?

Apache URL rewrite logic can be written either in conf or .htaccess file. Which one is more suitable, for which occasion? And let's say I have .htaccess in my web root directory, and I have a conf file defined on Apache/conf directory also, which file will kick in first? ...

Apache .htaccess password protect with relative path

I want to create a .htaccess file in my DocumentRoot, so that the directory is password protected. But the password file, I want to specify by using the relative path of DocumentRoot. So, if I am checking out the code in another system, it just works as it is. The password file will be part of my source control. How can I access the ...

How can I get non existant files mapped correctly in .htaccess?

Duplicate: How to rewrite non existant files to ‘default’ files? (.htaccess) How would I "rewrite" to a location if a file doesn't exist? I don't want to use a 404 redirect, but an actual rewrite. So for example, let's say it is a directory with images. If the image isn't found, then it rewrites to a default image? I.e., ima...

.htaccess URL Rewrite to Subdirectory

What is the best method to rewrite anything below "/some/subdir" to "/some/subdir/projects" like from this: http://www.mydomain.com/some/subidr/test/ ... to this: http://www.mydomain.com/some/subdir/projects/test/ I found a similar question posted, but the solution didn't seem to work in my case. My current attempt so far (which do...

Zend/Apache mod_rewrite... what's wrong?

The following url works ok: http://localhost/index/index/ However, I am unable to _get$ variables when they come in like this: http://localhost/index/index/test/1234/test2/4321 -but- I can however, _get$ the variables these ways: http://localhost/index.php?test=1234&amp;test2=4321 http://localhost/index?test=1234&amp;test2=4321 h...

htaccess URL rewriting speed optimization

My server support tells me my htaccess URL rewrites are causing an overhead. I use URL rewriting for "nicer" URLs, mainly (like example.com/?foo=bar will be example.com/foo/bar or so). Generally speaking, what are some tips & tricks to keep in mind when aiming to optimize the htaccess RewriteEngine? ...

Apache FilesMatch - matching a folder in the regular expression

Hi, I'm trying to cache some files using a .htaccess file for Apache2. I want to cache a particular folder longer than anything else, so i've been trying to use the FilesMatch directive like this: <FilesMatch "skins(.*)\.(jpg|png|gif)"> ExpiresDefault A2592000 </FilesMatch> I'm hoping to be able to cache all image files in ...

Is protecting a website directory with a .htaccess file secure?

I was wondering if protecting a web directory with an .htaccess file (with the .htpasswd file outside the public apache webroot) is a secure way to protect a directory (and its contents). Could someone explain the Do's and Don'ts of this kind of protection? ...