2015-12-02 96 views
1

,同时做一些工作我有这个问题,我couldint修复如何删除/index.php?/同时重定向301个笨pyrocms

域是在子域多语种这样的链接

http://ru.example.com

所以我需要重拍它是目录:

http://example.com/ru

,直到没有W¯¯每一件事情是好工作找

,而我试图旧链接到新的链接重定向 此htaccess的代码

RewriteEngine on 
RewriteCond %{HTTP_HOST} ^ru.example.com$ 
RewriteRule ^(.*)$ http://example.com/ru/$1 [L,NC,QSA] 

所以结果是 example.com/ru/index.php?/关于美

及其打错的电话我想帮助这个使用Pyrocms

example.com/ru/about-us 

IM构建于codignit成为呃

+0

读Pyrocms笨的主index.php文件解决

这个http://w3code.in/2015/09/how-to-remove-index-php-file-from-codeigniter-url/ – Ricky

+0

谢谢我们解决了,我发布了答案 – user3687656

回答

0

最后它基于CMS

我的老板添加了此代码和问题解决

if (strpos($_SERVER['SERVER_NAME'], 'ar.') !== false) { 

$pageURL = 'http'; 
if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") { 
    $pageURL .= "s"; 
} 
$pageURL .= "://"; 
if ($_SERVER["SERVER_PORT"] != "80") { 
    $pageURL .= str_replace('ar.', '', $_SERVER["SERVER_NAME"]) . ":" . '/ar/' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"]; 
} else { 
    $pageURL .= str_replace('ar.', '', $_SERVER["SERVER_NAME"]) . '/ar/' . $_SERVER["REQUEST_URI"]; 
} 

header("HTTP/1.1 301 Moved Permanently"); 
header("Location: " . $pageURL); 
die(); 
} 

谢谢...