동일한 Magento 설치에서 실행되는 abc.com 및 pqr.com이라는 두 개의 웹 사이트가 있습니다. 이제는 각 Magento 디렉토리에 "blogs"폴더를 만들고 wordpress라는 두 개의 인스턴스를 blogs/abc 및 blogs/pqr 폴더에 설치 한 Wordpress를 통해 해당 도메인 각각에 대한 블로그를 만들고 싶습니다.다중 사이트에서 블로그 구성 Magento 설정
www.abc.com/blog 및 www.pqr.com/blog에 대한 요청이 blogs/abc 및 blogs/pqr 폴더로 라우팅되도록 루트 디렉토리에서 .htaccess 또는 index.php를 어떻게 구성합니까? 각기.
내 블로그 URL의 양식의 abc.com/blog이어야하고 가상 호스트 설정 (보통은/etc/아파치에 액세스 할 수있는 경우
############################################
## you can put here your magento root folder
## path relative to web root
RewriteBase/
############################################
## uncomment next line to enable light API calls processing
# RewriteRule ^api/([a-z][0-9a-z_]+)/?$ api.php?type=$1 [QSA,L]
############################################
## rewrite API2 calls to api.php (by now it is REST only)
RewriteRule ^api/rest api.php?type=rest [QSA,L]
############################################
## workaround for HTTP authorization
## in CGI environment
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
############################################
## TRACE and TRACK HTTP methods disabled to prevent XSS attacks
RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
RewriteRule .* - [L,R=405]
############################################
## redirect for mobile user agents
#RewriteCond %{REQUEST_URI} !^/mobiledirectoryhere/.*$
#RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
#RewriteRule ^(.*)$ /mobiledirectoryhere/ [L,R=302]
############################################
## always send 404 on missing files in these folders
RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
############################################
## never rewrite for existing files, directories and links
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
#Redirect Blogs
#RewriteCond %{HTTP_HOST} ^(?:www\.)?(abc|pqr)\.com$ [NC]
#RewriteRule ^blog(?:/(.*))?$ /blogs/%1/$1 [NC,L]
############################################
## rewrite everything else to index.php
RewriteRule .* index.php [L]
</IfModule>
이 코드를 ################## 바로 위에 쓸 때 ################### ## ## 다른 모든 것을 index.php에 다시 작성하십시오. RewriteRule. * index.php [L] - http : //www/example.com에 http://www.example.com/blog/redirects를 요청합니다. = abc. – SarthakGupta
귀하의 규칙을 더 잘 이해할 수 있도록 질문에 현재 htaccess를 게시하십시오. –
내 .htaccess에서 리디렉션 섹션을 추가했습니다. – SarthakGupta