rewriterule questions

rewriterule questions

Posted by: mshick
Posted on: 2006-03-12 21:36:00

I am attempting to redirect requests to my domain name, michaelshick.com to the subdirectory /site. I am doing this so that I can use WebDAV to manage my site files. Still, I want to be able to have other directories directly off of the michaelshick.com directory, such as michaelshick.com/blog.

Is there a way I have all requests made to michaelshick.com redirected to /site but maintain /blog in it's current location? That is to say, I don't want to have to move /blog to michaelshick.com/site/blog in order for it to remain accessible with the redirect in place.



Re: rewriterule questions

Posted by: Atropos7
Posted on: 2006-03-12 23:20:00

In reply to:

Is there a way I have all requests made to michaelshick.com redirected to /site but maintain /blog in it's current location?


RewriteBase /
RewriteCond %{REQUEST_URI} !^/site
RewriteCond %{REQUEST_URI} !^/blog
RewriteRule (.*) /site/$1 [R]

See the documentation for an explanation: URL Rewriting Engine



cool Perl / MySQL / HTML+CSS

Re: rewriterule questions

Posted by: silkrooster
Posted on: 2006-03-12 23:29:00

What about just redirecting the pages like so:
(Place the following in a .htaccess file)
Redirect permanent index.html http://subdomain.example.com/index.html

Silk

Re: rewriterule questions

Posted by: mshick
Posted on: 2006-03-13 05:47:00

Thank you, that worked like a charm for most of my directories--with one exception.

I have a another WebDAV enabled directory, /dropbox, exisiting at the same level as the others. This directory was password protected (for read) and loading it would bring up a password prompt.

With the rewrite functioning firefox simply says "Firefox has detected that the server is redirecting the request for this address in a way that will never complete." I can still access the directory as a web folder, and if I turn off the "password protect this directory" option in DH control panel I am able to access/read the directory with no problems.

Is there any way to preserve the password protection with a rewrite in place?


Re: rewriterule questions

Posted by: Atropos7
Posted on: 2006-03-13 08:43:00

Add a RewriteCond for /dropbox


cool Perl / MySQL / HTML+CSS

Tags: blogredirectdomain namewebdavdirectories