apache - mod_rewrite to absolute path in .htaccess - turning up 404 -
I want to map several directories to one URL:
www.example < / P>
/ former>My web root is
/ / www.example.com/login
/ Www / customer / some_other_dir / manual
In mod_alias, this
will be equal toalias / manual / www / customer / some_other_dir / manual
, but as I have only for
.htaccess
Usage, I can not use aliases, so use memod_rewrite
Do not be.What I have just got from him is the following:
rewrite rule ^ manual (/(.*))?$ / www / htdocs / customname / manual / $ 2 [L]
This works in the sense that requests are identified and redirected properly, but I get 404 which looks like this (focus on absolute path ):
The requested URL / www / htdocs / custom name / manual / resume-to-domain.htm on this server was not found.
However, I have checked with PHP:
echo file_exists (...)
and this file is definitely present.Why would this happen? According to the mod_rewrite docs, it is possible, even in the .htaccess file. I understand that when mod_rewrite is done in .htaccess, then there will be an automatic prefix, but not for full paths, right?
It should not be a right issue too: This web is not in the root, but in the FTP tree, which is only a user, the main FTP account is used.
I can change the web route at any time in the control panel, but the way I describe it, I want to work. / P>
This hosting is shared, so I do not have any access to error logs.
I just checked, this is not an incorrect 301 redirect, only an internal rewrite
AFAIK mod_rewrite works at 'protocol' level (meaning on wire HTTP) So I suspect that You are receiving HTTP 302 with your directory path in place.
So I'm afraid you can get trapped until your hosting allows you to follow the symbolic link; You can link to that place under your current document route (It is assumed that you have shell access or it is possible using FTP or your control panel.)
Edit: It actually mentions it now I suspect that they are not allowing enough permissions.
Comments
Post a Comment