|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
AliasMatch - or something else???
I'm not sure if I'm on the right track here - is AliasMatch what I need?
I want to redirect every users home page so that it ends up at: /user/ instead of /~user. I did this one and it's fine: Alias /user_a/ "/Volumes/UserData/dml_users/user_a/Sites/" <Directory "/Volumes/UserData/dml_users/user_a/Sites/"> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all </Directory> What would I use (using these exact pathnames) to get the same result for every user in that folder? If anyone can help I'd appreciate it and it will be passed on! |
|
#2
|
||||
|
||||
|
Yeah, I think AliasMatch'd probably do the trick. Sample syntax follows:
AliasMatch ^/icons(.*) /usr/local/apache/icons$1
__________________
Please don't PM me asking for solutions outside the scope of a thread. Keeping all responses in a thread stands to help others who come along later, which is after all what this forum's all about. |
|
#3
|
|||
|
|||
|
A little clarification please
Thanks for the post! Sorry to be obtuse, but could you explain or point me towards any docs that tell exactly what the expressions in that example mean? I don't have any experience of regular expressions and would like to find a primer or something relating to their use in Apache.
|
|
#4
|
||||
|
||||
|
You should be able to google "regular expression" or "regex" and find a million tutorials that'll help you out. To get you started, the expression I listed above looks for a string that begins with "/icons" plus any number of other characters (of any type). The ^ means "begins with," the . means "any character of any type," and the * means "any number." The parentheses group everything after "/icons" together and save the resulting match in the variable $1.
So an icon referenced as "/icons/my_icon.gif" would be aliased to "/usr/local/apache/icons/my_icon.gif" because everything after "/icons" is stuck in $1, which is appended to "/usr/local/apache/icons". |
|
#5
|
|||
|
|||
|
Expressions
Thanks very much !
|
![]() |
| Viewing: Dev Articles Community Forums > Web Design > Web Server Configuration > AliasMatch - or something else??? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|