• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 508
  • Last Modified:

mod_alias in .htaccess

Hi,

I know you're not allowed to have a alias in .htaccess, but I would like, on my hosting server, to create an alias (I use godaddy).  Is there anything I can do about this?
0
paulj1999
Asked:
paulj1999
  • 2
1 Solution
 
caterham_wwwCommented:
You can test if mod_rewrite is available
RewriteEngine on
# rewrite /alias/foo to /folder/foo
RewriteRule ^alias/(.*) /folder/$1 [L]

Open in new window

0
 
paulj1999Author Commented:
Sorry for taking so long to get back to this question.  
is /folder/$1 an absolute path?  

For example, if I have my web root pointed to /site/web/ , would the above method work if I wanted to point to /site/leg

would I do
RewriteEngine on
RewriteRule ^leg/(.*) /site/leg/$1 [L]


Thanks
0
 
caterham_wwwCommented:
> is /folder/$1 an absolute path?  

No, an URL-path. You can't rewrite outside of the document_root via .htaccess files. What you could do is to create a symlink leg which points to /site/leg/
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now