如何将目录http://www.example.com/contact/重定向到文件http://www.example.com/contact-us.php
我的htaccess文件内容
RewriteEngine开启
RewriteCond%{HTTP_HOST}!^ www。
RewriteRule ^(。*)$ http://www.% {HTTP_HOST} / $ 1 [R = 301,L]
RewriteRule ^ / contact / $ http://www.example.com/contact-us.php [L,R = 301]
答案 0 :(得分:0)
RewriteRule ^ / contact / $ http://www.example.com/contact-us.php [L,R = 301]
^ /在htaccess的RewriteRule中将永远不匹配。如果这在文档根目录中,请删除第一个Running virtualenv with interpreter julia-1.0.2/bin/julia
ERROR: LoadError: ArgumentError: Package os not found in current path:
- Run `import Pkg; Pkg.add("os")` to install the os package.
Stacktrace:
[1] require(::Module, ::Symbol) at ./loading.jl:823
[2] include at ./boot.jl:317 [inlined]
[3] include_relative(::Module, ::String) at ./loading.jl:1044
[4] include(::Module, ::String) at ./sysimg.jl:29
[5] exec_options(::Base.JLOptions) at ./client.jl:231
[6] _start() at ./client.jl:425
in expression starting at /home/ebasfad/.local/lib/python3.5/site-packages/virtualenv.py:5
。
在.htaccess中使用mod_rewrite时,将您带到该htaccess文件的URL路径已被剥离,并且您仅匹配相对/剩余路径。