Re: mod_rewrite rule

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Eric Covener wrote:
On Tue, Nov 4, 2008 at 4:16 PM, Seb <spluque@xxxxxxxxx> wrote:
Hi,

I'm having trouble specifying a seemingly very simple rewrite rule in
.htaccess, where I simply want to redirect from say
http://some.host.com/path to http://some.host.com/Path, and any
subdirectories of course.  I thought this would do it:

RewriteRule  ^path(.*)$  /Path$1  [last]

but it doesn't.  Any help would be appreciated.


What does it do?  Can you enable the RewriteLog?  Do you have
RewriteEngine on? Are your htaccess files being read (AllowOverride
none)

Hi. Sorry to butt in with what may look at first unrelated to the problem at hand, but.

I regularly see on this list a bunch of questions related to RewriteRule's used in .htaccess files.

On the other hand, in the Apache 2.2 mod_rewrite on-line help, there is this paragraph : RewriteRule can be used in per-directory config files (.htaccess). In such a case, it will act locally, stripping the local directory prefix before processing, and applying rewrite rules only to the remainder. When processing is complete, the prefix is automatically added back to the path.

Now, isn't the above (the original OP question) kind of a chicken-and-egg issue ?

I mean, before Apache even gets to the .htaccess file, it has to find the path to the directory wher the .htaccess file is. And once it finds it, it would have to re-interpret that same path and change it.
It does not seem to make a lot of sense..

Now, if instead of being in the .htaccess file, it was in the httpd.conf, then it would be another matter.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux