Answers:
您应该登录后端,然后转到system->configuration->web->Search Engines Optimization
并将字段设置Use Web Server Rewrites
为No
。清除缓存,然后重试。
您可能还想重建索引。您不应该从中删除所有值core_url_rewrite
。重新索引过程应再次添加值。
mysite.com/index.php/admin
伴随着UPDATE core_config_data SET value = 0 WHERE path = 'web/seo/use_rewrites';
。
您需要重建的core_url_rewrite
表,即使它是空的。
CREATE TABLE `core_url_rewrite` (
`url_rewrite_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`category_id` int(10) unsigned DEFAULT NULL,
`product_id` int(10) unsigned DEFAULT NULL,
`id_path` varchar(255) NOT NULL DEFAULT '',
`request_path` varchar(255) NOT NULL DEFAULT '',
`target_path` varchar(255) NOT NULL DEFAULT '',
`is_system` tinyint(1) unsigned DEFAULT '1',
`options` varchar(255) NOT NULL DEFAULT '',
`description` varchar(255) DEFAULT NULL,
PRIMARY KEY (`url_rewrite_id`),
UNIQUE KEY `UNQ_REQUEST_PATH` (`request_path`,`store_id`),
UNIQUE KEY `UNQ_PATH` (`id_path`,`is_system`,`store_id`),
KEY `FK_CORE_URL_REWRITE_STORE` (`store_id`),
KEY `IDX_ID_PATH` (`id_path`),
KEY `IDX_TARGET_PATH` (`target_path`,`store_id`),
KEY `FK_CORE_URL_REWRITE_PRODUCT` (`product_id`),
KEY `IDX_CATEGORY_REWRITE` (`category_id`,`is_system`,`product_id`,`store_id`,`id_path`),
CONSTRAINT `FK_CORE_URL_REWRITE_CATEGORY` FOREIGN KEY (`category_id`) REFERENCES `catalog_category_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CORE_URL_REWRITE_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CORE_URL_REWRITE_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=283490 DEFAULT CHARSET=utf8;
然后清除缓存,您可能还需要在命令行中运行重新索引(全部重新索引或仅对URL进行重新索引)。
`php shell/indexer.php reindexall`
TRUNCATE core_url_rewrite
,DELETE FROM core_url_rewrite
还是DROP TABLE core_url_rewrite
?