需求:如果想将wordpress站点的目录移到magento1.x的子目录,通过magento的URL来访问,应该怎么做呢?
尝试:需要修改相应的静态化规则。如nginx的,可参考这个:https://docs.ukfast.co.uk/ecommercestacks/magento/magento1/wpinsubdir.html
location ~ ^/wp/ {
index index.php index.html index.htm;
try_files $uri $uri/ @wphandler;
expires 30d;
location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
add_header Cache-Control "public";
add_header X-Frame-Options "SAMEORIGIN";
expires +1y;
try_files $uri $uri/ /get.php?$args;
}
location ~* /(wp-admin/|wp-login\.php) {
try_files $uri $uri/ @wphandler;
index index.html index.htm index.php;
fastcgi_pass replacemebackend;
add_header Cache-Control "no-store";
fastcgi_buffers 1024 4k;
#fastcgi_param HTTPS $my_https; # Uncomment the below for SSL offloading
#fastcgi_param SERVER_PORT $my_port; # Uncomment the below for SSL offloading
fastcgi_read_timeout 600s;
fastcgi_connect_timeout 600s;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* \.php$ {
try_files $uri $uri/ =404;
fastcgi_pass replacemebackend;
#fastcgi_param HTTPS $my_https; # Uncomment the below for SSL offloading
#fastcgi_param SERVER_PORT $my_port; # Uncomment the below for SSL offloading
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
location @wphandler {
rewrite / /wp/index.php;
}