www.example.org.uk을 example.org.uk/subdirectory로 리디렉션 한 다음 하위 디렉토리를 숨기려고합니다. 따라서 주소 표시 줄에 www.example.org.uk 만 표시됩니다.루트 폴더를 하위 디렉토리로 리디렉션하고 GoDaddy에서 .Htaccess를 사용하여 숨기는 방법?
이 내가 사용되었다 (https://my.bluehost.com/cgi/help/347에서) 원래의 코드는 다음과 같습니다
# BlueHost.com
# .htaccess main domain to subdirectory redirect
# Do not change this line.
RewriteEngine on
# Change example.com to be your main domain.
RewriteCond %{HTTP_HOST} ^(www.)?example.org.uk$
# Change 'subdirectory' to be the directory you will use for your main domain.
RewriteCond %{REQUEST_URI} !^/subdirectory/
# Don't change the following two lines.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Change 'subdirectory' to be the directory you will use for your main domain.
RewriteRule ^(.*)$ /subdirectory/$1
# Change example.com to be your main domain again.
# Change 'subdirectory' to be the directory you will use for your main domain
# followed by/then the main file for your site, index.php, index.html, etc.
RewriteCond %{HTTP_HOST} ^(www.)?example.org.uk$
RewriteRule ^(/)?$ subdirectory/index.php [L]
문제는이 코드의 어느 것도 작동하지 않는다는 것이다. -
유래를 검색하고 조언을 사용한 후이 현재 코드 : 불행하게도 내부 오류가 표시됩니다
Options +FollowSymLinks -Multiviews
<IfModule mod_rewrite.c>
# BlueHost.com
# .htaccess main domain to subdirectory redirect
# Do not change this line.
RewriteEngine on
# Change example.com to be your main domain.
RewriteCond %{HTTP_HOST} ^(www.)?grampianyoga.org.uk$
# Change 'subdirectory' to be the directory you will use for your main domain.
RewriteCond %{REQUEST_URI} !^/gya2/
# Don't change the following two lines.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Change 'subdirectory' to be the directory you will use for your main domain.
RewriteRule ^(.*)$ /gya2/$1
# Change example.com to be your main domain again.
# Change 'subdirectory' to be the directory you will use for your main domain
# followed by/then the main file for your site, index.php, index.html, etc.
RewriteCond %{HTTP_HOST} ^(www.)?grampianyoga.org.uk$
RewriteRule ^(/)?$ gya2/index.php [L]</IfModule>
이 오류 파일 상태는 I GoDaddy를 사용하고 :[Wed Mar 26 14:22:35 2014] [9566783] [core:alert] [client 97.74.104.6:60525] /var/chroot/home/content/83/9566783/html/.htaccess: RewriteRule: bad flag delimiters
그리고 나는 그들이 믿는 것을 자신의 설정을 가지고 있습니다. 누구든지 어떤 제안이 있습니까? 시도한 지원 및 분명히 그들은 스크립팅을 도울 수 없습니다.
'RedirectMatch ^/foo/$/foo/bar /'또는'RedirectMatch ^/foo/$/bar/baz /'디렉토리의 상위 디렉토리에'.htaccess' 파일을 추가해보십시오. . [apache2를 하위 디렉토리로 리디렉션하는 방법] (http://serverfault.com/q/9992/145545)을 참조하십시오. – jww