rewritebase

How to use RewriteBase in .htaccess to rewrite img tags?

I guess I don't understand RewriteBase. I have a (drupal) site built on my dev server and everything works perfectly. I created a fake URL for it in my own apache and hosts file, so I get to my local version with "local-examplesite.com". Eventually it will live at www.examplesite.com, but I want to put up a draft with a temp URL at my...

Why is Apache's RewriteRule revealing local paths?

I'm trying to use RewriteRules in .htaccess with relative paths, but Apache seems to want to output the physical path instead of the server path whenever I try to output a relative path. Absolute and server-root paths work fine. For example: RewriteEngine On # this works fine, 127.0.0.1/ab redirects to 127.0.0.1/cd RewriteRule ^ab$ /cd...

With mod_rewrite can I specify a RewriteBase within a RewriteCond?

I'd like to have my .htaccess file specify a different RewriteBase depending on whether the .htaccess file is on my local machine or on a web server. This is the mod_rewrite code I tried, however, it did not work: RewriteCond %{HTTP_HOST} ^localhost:8080 RewriteBase /example/ RewriteCond %{HTTP_HOST} ^www.example.com RewriteBase / Th...

Many RewriteBase in one .htaccess file?

Hello I have a domain and a wordpress-blog on same server. Now I have a problem (surprise). The wordpress is located on /httpdocs/blog/ and domain is pointing to /httpdocs/ and I'm trying to redirect it to /httpdocs/domain/. But, obvisiously, I have permalinks in Wordpress. Here's my current .htaccess: RewriteEngine On RewriteBase /b...

Base Href vs. .htaccess RewriteBase

Normally I use <base href="http://domain.com/" /><!--[if ie]></base><![endif]--> I haven't tried much with RewriteBase, I normally get confused and keep changing it till it works. Which method would be best, I obviously find the best solution because the links stay the same so that no links are broken most of the time when attachin...

Multilanguage site, redirect based on cookie or accept-language (RewriteRule)

Hi, A few weeks ago i asked a question about a multilanguage site (see http://stackoverflow.com/questions/3439668). That works perfect (thanks for that) But since I want to make my website nicer and I started adding more languages a new problem showed up. I want to see if I can redirect users directly to the site in their language, if ...

Apache .htaccess to redirect index.html to root, why FollowSymlinks and RewriteBase?

In order to redirect all somefolder/index.html (and also somefolder/index.htm) to somefolder/ I use this simple rewrite rule in Apache .htaccess file: RewriteEngine on RewriteCond %{THE_REQUEST} ^.*\/index\.html?\ HTTP/ RewriteRule ^(.*)index\.html?$ "/$1" [R=301,L] This works well! But at Google groups they suggest to add also: Opt...

.htaccess regex in RewriteRule matches, variables remain empty

I have some conditions and rules in my .htaccess: RewriteCond %{DOCUMENT_ROOT}/assets/img$1/.$2.$4/$3.$4 -f RewriteRule ^assets/img(.*)/[a-zA-Z0-9-_\.]*\.[^/]+\.[a-z]{2,4}$ assets/img$1/.$2.$4/$3.$4 [NC] RewriteRule ^assets/img(.*)/[a-zA-Z0-9-_\.]*\.[^/]+\.[a-z]{2,4}$ assets/img/image.php?path=$1&file=$2.$4&template=$3 [NC,L,QSA] The ...