mod-rewrite

Using htaccess rewrite to make a subdirectory be its own root for root relative path requests

Can I use htaccess to capture requests from a certain subdirectory and make that directory use itself as the root directory for any root relative path requests? For example if I have... http://www.example.com/subFIXED/subANY/restofpath ...where subFIXED is always the same directory, subANY is any immediate subdirectory of subFIXED, an...

Mod_rewrite not working properly

I have this in my .htaccess file... RewriteEngine on RewriteRule ^/invite$ /invite.html It's meant to let a user access this url: http://mysite.com/invite and display the invite.html page. I don't want to redirect the user, but just show them the invite.html page from a better looking URL. When I browse to http://mysite.com/invite...

Wordpress rewrite image path

I've got a website that is running WordPress. It has several pictures that I am retrieving from a datafeed. The images from the datafeed are at locations like: http://image4.example.com/640/examples/example.jpg http://image4.example.com/640/example.jpg The image4 and 640 locations can change. I want to rewrite the images to where th...

Can host be extracted from referer in mod_rewrite for htaccess / apache?

I'm trying to do a rewrite where I need the host part of the HTTP_REFERER. So if the referer is e.g. http://www.example.com/some/path I need to extract the host part, www.example.com and use it in the RewriteRule, so that it rewrites to /some/serverpath/www.example.com/subfolder. Is this possible? ...

RewriteRule - take all urls with dash

I need to redirect all urls with dash to a specific page. For example: site.com/this-url to site.com/page.php?url=this-url RewriteRule RewriteRule ^(.+-.+)$ page.php?url=$1 just hang http. No response. What is wrong and how it can be done? ...

Mod_rewrite causing 404 error

These are the .htaccess files from two of my localhost sites. Virtual host 1 (mysite1.com): # this is the initialization Options +FollowSymLinks RewriteEngine On # Turn on the rewriting engine RewriteRule ^news-07/?$ news_01_06_2007.php [NC,L] # Handle requests for "news" RewriteCond %{REQUEST_FILENAME} !-s RewriteRule ^(...

Placing .htaccess file in var/www folder messes my website up...

I am playing with mod_rewrite now, and have successfully enabled it. However, I need to put a htaccess file inside var/www/ in order to achieve what I want, which is to rename Urls simply... When I place it my website becomes very strange and nothing basically works... Is there any code I need to put into the htaccess file in order for...

How can I do a non-www to www redirect without breaking Flash security?

So I have a SWF file here (direct link, it autoplays, sorry): http://www.elativemarketing.com/images/portfolio/ann-taylor/anntaylor-video-alia-holiday.swf that, when I have these .htaccess rules enabled: RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] Fails out with this error: Error: Sl...

Problem in enabling mod_rewrite in Ubuntu.

Hi, I am trying to change from windows to linux server. And for that i am trying to enable mod_write in ubuntu. I have taken all the necessary steps to enable the mod_rewrite as mod_rewrite is displayed under loaded modules. I have set all the permissions for the .htacess file. But for some reason the rewrite does not appear to be worki...

mod_rewrite: Different rules on different domains, same www-root

I have 8 domainnames that point to the same www-root. If the main domain is accessed, you are pointed to index.php, and from there on, the URL's are like: index.php?p=contact etc. If, however, you access one of the other 7 domains, that point to different units, you are initially pointed to: index_local.php, and from there on it goes lik...

Trying to make mod_rewrite to work on Windows

Hello guys, I'm having some trouble confinguring Apache mod_rewrite on Windows. I'm using latest version of XAMPP on Windows Vista. Here's my httpd.conf file: LoadModule rewrite_module modules/mod_rewrite.so <Directory /> Options FollowSymLinks AllowOverride All </Directory> <Directory "D:/Server"> Options Indexes FollowSymL...

htaccess Rewriterule to make one query part of another

I have a url /embed?t=X and I want to redirect it to /page/embed/X where X is any number of alpha numeric characters. I know must redirect rules go the other way but for the purpose of the applciation I need to reverse it. Any ideas? I have tried things like: RedirectRule ^embed\?t\=([a-zA-Z0-9]+)$ /page/embed/$1 but with no luck. ...

Redirect question using mod_rewrite (no extensions - root of site)

Hi, I'm having a small problem with mod_rewrite I have the following in my .htacces: Options +FollowSymlinks RewriteEngine on RewriteRule ^(.+)\.htm$ index.php?name=$1 [NC] This is my index.php file: <?php echo $_GET['name']; ?> This works great for the following url: www.mySite.com/this is an example.htm this would display ...

Unexpected htaccess behaviour (mod_rewrite and apache)

Yeah, mod_rewrite is driving me crazy. Here is the problem: my htaccess RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [L,QSA] when i try to access the page advantix (so address was www.mywebsite.com/advantix), i'm being redirected to advantix/?url=advantix Looking at the access log, i have a suspicious ...

mod_rewrite one url to another url without changing source url

Is it possible to do a mod_rewrite from one url to another without changing what appears in the address bar? Example: Source URL is http://domain1.com/news Target URL is http://domain2.com/news I want to render pages from http://domain2.com/news/ but have http://domain1.com/news appear in the address bar. Is this possible? I've got ...

.htaccess rules in Kohana 3.0 ?

Hi I'm running a Kohana setup on my local apache server. I've created a 'htdocs' folder which houses the index.php file in the kohana directory. So that the system files are not available to visitors. Now I wan't to remove index.php from the URL everytime I visit another controller, so I've tried fooling around with the .htaccess provid...

YUI Compressor + gzip causes Illegal Character error in jQuery

When I minify jquery using YUI compressor, it works fine. When I then add gzip compression (and serve this version via mod rewrite), the gzipped version throws this error: illegal character in jquery.min.js on line 1 Line 1 is: �������M�����������s�8�0�?�!sz�dKr�=� This results in a "jquery is not defined" error. I am using the follo...

Apache - "dynamic" rewrite rule

Hi there. I'm working on a Zend Framework project where I've stumbled across a bit of a problem. The problem originates from the fact that modules are 2nd class citizens in Zend Framework. In my project, I'd like for each module to have a folder containing files which are to be accessed from the outside - files such as stylesheets, java...

django inner redirects

Hello I have one project that in my own development computer (uses mod_wsgi to serve the project) caused no problems. In live server (uses mod_fastcgi) it generates 500 though. my url conf is like this: # -*- coding: utf-8 -*- from django.conf.urls.defaults import * # Uncomment the next two lines to enable the admin: from django.con...

htaccess - rewrite rule issue - not able to get 10th variable

I am not able to get the 10th variable. I am getting 1st variable appended with a 0(zero) instead. RewriteRule ^(browse_by_exam)/(classes|packs|tutor_search)/([a-zA-Z0-9\.\á\á\â\ä\ã\å\æ\ç\è\é\ê\ë\ì\í\ï\ð\ñ\ò\ó\ô\õ\ö\ø\ù\ú\û\ü\ý\þ\¿\¡\«\»\ÿ\ß\$\*\!\-\=\@\#\%\^\(\)\_\&\{\}\;\,\<\>\?\`\~\[\|\"\'\]\\\ +]+)/([0-1])/([0-9]+)/([0-9]+)/([0-9]+)...