모든 파일 및 폴더 (디렉토리)를 www.example.com/*에서 www.example.com/website/로 리디렉션하고 싶습니다. 현재의 .htaccess는 다음과 같습니다.htaccess 와일드 카드 리디렉션
RewriteEngine on
# To set your custom php.ini, add the following line to this file:
# suphp_configpath /home/yourusername/path/to/php.ini
RewriteCond %{HTTP_HOST} ^example\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteRule ^/?$ "http\:\/\/www\.example\.com\/website\/" [R=301,L]
Redirect 301 /* http://www.example.com/website/
그러나 작동하지 않습니다.
1) (이중 검사) "리디렉션"은 실제 301 리디렉션을 의미합니다. 또는 단지 재 작성합니다 (예제에서는 301을 보여줍니다). 2) 리다이렉트하는 방법이 약간 불분명하기 때문에 (URL-> URL에서) "실제"예제가 필요하지 않습니다. (현재 예제에서 몇 가지 문제가 있습니다 :/* ->/website /') – LazyOne
누군가 www.example.com/test.html로 이동하려고하면 실제로 www.example.com/website/test.html로 이동하기를 바랍니다. 누군가 www.example.com/documents/test.pdf로 이동하면 www.example.com/website/documents/test.pdf로 이동하게합니다. – Chris
@LazyOne 내가 지금해야 할 일이 보이니? – Chris