.htaccess

Do HTTP authentication over HTTPS with URL rewriting.

I am trying to protect the ~/public_html/dev directory using http auth basic, but to make that secure I want to run it over ssl. The middle section of the below .htaccess file switches to https if the request URI begins with /dev and works. The last section of the file works as well but does not work properly with the https redirect. ...

Apache / htaccess rewrite - From domain to subdomain

Hiya, I'm trying to find out how to edit my htaccess to push all requests for files in: http://www.domain.com/images to head off to: http://cdn.domain.com/images The reasoning being i'd like to parrelise http requests over a number of domains/subdomains to speed up page load. Is this possible through apache scripting, or will I hav...

.htaccess mod_rewrite has different result on different sites

Hi, I am using mod_rewrite to create SEO URLs. Basically the thing works in the following way: all requests are caught by .htaccess and redirected to a php script (let's say transform.php). transform.php parses SEO URL and transforms it into a normal URL, then includes index.php, then catches application's (index.php's) output and uses ...

joomla .htaccess file rewrite rule explanation required

Hi, I'm trying to understand the following lines in joomla's .htaccess file. Can someone explain this please #RewriteCond %{REQUEST_FILENAME} !-f #RewriteCond %{REQUEST_FILENAME} !-d #RewriteCond %{REQUEST_URI} !^/index.php #RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC] #RewriteRule (.*) index.php ...

htaccess help needed

hello to all, i'm doing maintenance work on a cms and have found the following htaccess file: <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine On #RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] i'm having trouble understanding it. the reason a...

htaacces redirect

How to : domain.com.ua/e107_plugins/forum/forum_viewtopic.php?847 redirect to domain.com.ua/blog.php?blog=1847 847 + 1000- it's new ID valud. Thank you ...

Trying to put an exception to RewriteRule in .htaccess

I am redirecting all requests like so: RewriteRule ^sitemap.xml$ sitemap.php?/ [QSA,L] # the line below is the one I'm having trouble with RewriteCond %{REQUEST_URI} !^market-reports$ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*) /index.php?section=$1 [QSA,L] All my incoming links are mea...

Prevent direct access to files with .htaccess

Ok, I am using codeigniter and I have a secure login section. Inside the login users are able to download files. What I need to do is stop people been able to access the file directly. I figure there will be a way using .htaccess to check for a authenticated variable that I could set in the POST array or something similar. Any pointers...

htaccess not working as it should

well, ofcourse its not working, im still a n00b :) this is the code that i have : Options +FollowSymLinks RewriteEngine on RewriteRule (.*)\.css - [S=7] RewriteRule (.*)\.jpg - [S=6] RewriteRule ^gallery gallery.html [L] RewriteRule (.*)/(.*)/ index.html?page=$2 [L] RewriteRule (.*)/(.*) index.html?page=$2 [L] RewriteRule (.*)/ index....

Simple mod_rewrite and website dir structure

I am making a site with photo albums for agents. Each agent has his folder with .css file. Each agent dir has album folders with index.php and .css /example.com/ /agent001/ agent001.css /000005/ index.php main.css /photos/ aaa.jpg bbb.jpg /000006/ index.php ...

.htaccess rewrite rule for redirects

I've been fighting this for a while and can't seem to make it work. My old system used a lot of query strings to render pages but they are no longer necessary. My url is below: OLD URL: www.example.com/links.php?section=5&catid=52 NEW URL: www.example.com/mhfs/links The name links is coincidental and not necessarily from the old pa...

.htaccess port redirection with Apache

Hi, I'd like to redirect http://www.mydomain.com/service to http://www.mydomain.com:PORT where PORT is the port of the service which will serve the pages. Is it possible given it's apache which is listening on port 80 so which will perform the redirection, and it's an unrelated service which is listening on PORT? What's the syntax? I ...

Redirect .aspx to WordPress

I'm transferring an ASP.NET site to WordPress, and all my URLs are identical, except for the .aspx suffix. Is there a one line regex htaccess solution that will forward people from foo.com/bar/page.aspx to foo.com/bar/page and foo.com/bar.aspx to foo.com/bar ...

numeric RewriteRule with .htaccess

I would like to send URL requests to a PHP script which will handle the 301. The URI's I want to capture are dates, like 26-11-2010, without the dashes: www.mysite.com/261110/ (6 digits) What is the RewriteRule for this? my script is www.mysite.com/redirect.php?data=261110 ...

Apache URL rewrite - Tring to mask the folder name

I have a website located at example.com/cmsFolder which I want to move to example.com/newFolder. I can't manually move this as it completely breaks this stupid CMS. So I'm trying to use mod_rewrite to mask the folder name and keep it looking nice. RewriteEngine on RewriteRule ^cmsFolder/(.*)$ /newFolder/$1 [L] That fails with a 404. ...

It seems the mode rewrite in .htaccess apache is not working

I am trying to run iJab with Openfire server which requires me to redirect the /http-bind request to localhost:7070/http-bind. I copied the iJAb folder into my document root and wrote the following code inside .htaccess file within the directory AddDefaultCharset UTF-8 Options +FollowSymLinks Options +Indexes Options +...

mod_rewrite rule

I am new to mod_rewrite and have been using a generator but it doesn't work. This is an example of what I am trying to achieve. The original URL: http://subdomain.domain.com/company.php?test=TES001 The rewritten URL: http://subdomain.domain.com/company/AAA001 Options +FollowSymLinks RewriteEngine on RewriteBase / RewriteRule company/...

Apache wildcard setup -> php script -> htaccess ->scripts... ?

I have apache setup to wildcard direct all unknown trafic to one php script (default documentroot). This php script looks into a database and possibly finds the correct documentroot for the requested domain (or documetroot of the 404 error handler etc..). The problem is, that from within php script I know how to include another script,...

htaccess not called when the url point to an existing folder

Hi, I'm running zend server on windows 7. I'm using the htaccess from jooml: Options +FollowSymLinks RewriteEngine On RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR] RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR] RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR] RewriteCond %{QUERY_STRING} GL...

CakePHP .htaccess mod_rewrite configuration to exclude a particular folder/url

Hi I have a CakePHP installation in a sub folder in my server, I want to install another application inside that subfolder: root/public_html/subfolder/cake/ root/public_html/subfolder/app/ etc. now I need a custom application installed there: root/public_html/subfolder/my_custom_application/ I have something like this in my .htac...