forked from dlang/dlang.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
57 lines (43 loc) · 1.97 KB
/
.htaccess
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# dlang.org .htaccess file (local Apache configuration)
# Enable mod_rewrite
RewriteEngine On
# Indicate that this directory maps to the root
# directory of the domain.
RewriteBase /
# Phobos rewrites:
# Package files are now generated to std_foo.html
# instead of std_foo_package.html. This change was
# done to preserve the links to std.algorithm,
# std.range etc. after they were split into packages.
# However, we need redirects for packages in
# previous stable releases (namely, std.container).
RewriteRule ^(phobos(-prerelease)?/std_container)_package\.html $1.html [R=301,L]
Redirect 301 /COM.html http://wiki.dlang.org/COM_Programming
Redirect 301 /dll.html http://wiki.dlang.org/Win32_DLLs_in_D
Redirect 301 /htomodule.html http://wiki.dlang.org/Converting_C_.h_Files_to_D_Modules
Redirect 301 /memory.html http://wiki.dlang.org/Memory_Management
Redirect 301 /windows.html http://wiki.dlang.org/D_for_Win32
Redirect 301 /getstarted.html http://wiki.dlang.org/Getting_Started
Redirect 301 /tools.html http://wiki.dlang.org/Development_tools
RewriteRule ^changelog(.html)?$ changelog/index.html [R=301,L]
# OS detection for CLI manual
RewriteCond %{HTTP_USER_AGENT} Windows
RewriteRule ^dmd.html dmd-windows.html [R]
RewriteCond %{HTTP_USER_AGENT} Mac
RewriteRule ^dmd.html dmd-osx.html [R]
RewriteCond %{HTTP_USER_AGENT} Linux
RewriteRule ^dmd.html dmd-linux.html [R]
RewriteCond %{HTTP_USER_AGENT} FreeBSD
RewriteRule ^dmd.html dmd-freebsd.html [R]
# soft-fail to windows
RewriteRule ^dmd.html dmd-windows.html [L,R]
# legacy URLs of /spec/ pages
RewriteRule ^(spec|intro|lex|grammar|module|declaration|type|property|\
attribute|pragma|expression|statement|arrays|hash-map|struct|class|interface|\
enum|const3|function|operatoroverloading|template|template-mixin|contracts|\
version|traits|errors|unittest|garbage|float|iasm|ddoc|interfaceToC|\
cpp_interface|objc_interface|portability|entity|memory-safe-d|abi|simd)\
(\.html)?$ \
spec/$1.html [R=301,L]
# Error pages
ErrorDocument 404 /404.html