Forum Moderators: phranque
RewriteRule ^mypage-([0-9]+)\.html$ [b]/my[/b]page.html?id=$1 [L]
Jim
I think I wasn't clear.
The htaccess file is on a subdirectory and what I want is to get a file on the root of the server, for instance:
By requesting,
home/mysite/www/widget/myrewrite.html
I want the server to return,
home/mysite/www/mypage.html?id=1
The reason for having the htaccess on the subdirectory is because the subdirectory is actually an addon domain and I rather have one htaccess file for each domain than a huge file on root.
I've digged a lot for this and I don't even know if it's doable or maybe it's just not the right aproach to my problem...
In that case, the subdirectory *is* the root for that add-on domain, and you cannot 'go higher' using htaccess, because htaccess views your site using 'HTTP rules' of URL-to-filename mapping.
Again, you can use a symlink to link to another file or directory at the *nix level if that would solve your problem.
Jim
My host was pretty swift giving me shell access so I started messing around with symlinks yesterday.
But it's not working and I can't figure why
Here's my code:
ln -s home/client/public_html/ home/client/public_html/site2
After this a request for:
www.site2.com should return the contents of www.site1.com
but it doesn't.
I also tried creating a symlink only for a particular .html file but it also failed.
I then erased .htaccess on /site2 thinking it may be doing some strange redirect, but all the same.
Am I missing something?
Thks!