2013-03-19 29 views
0

我需要一個工作的RewriteRule來擺脫我的url(s)的/index.php/category/部分。Joomla .htaccess

bruteforce.tv/index.php/streams/shinigamily 
bruteforce.tv/index.php/streams/cash 
bruteforce.tv/index.php/streams/blacktigrex 
bruteforce.tv/index.php/streams/viktorwwe 

TO

bruteforce.tv/shinigamily 
bruteforce.tv/cash 
bruteforce.tv/blacktigrex 
bruteforce.tv/viktorwwe 

我不習慣把它與一個htaccess,因此我爲是完全一籌莫展道歉工作。

這與不工作RewriteRule ^streams/(.*)/?$ /$1 [L,NC,R]

Options +FollowSymLinks 

## Mod_rewrite in use. 

RewriteEngine On 

RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR] 
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR] 
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR] 
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) 

RewriteBase/

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 
RewriteRule ^streams/(.*)/?$ /$1 [L,NC,R] 
RewriteCond %{REQUEST_URI} !^/index\.php 
RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule .* index.php [L] 
+0

你不使用Joomla功能刪除index.php的任何原因?我會以此開始。 – isherwood 2013-03-19 14:08:22

+0

我不知道你的意思。如果它的URL重寫,它的啓用。但是爲此需要一個htaccess文件。 – RobbyBubble 2013-03-19 14:57:42

+0

我的錯誤。我忘記了2.5中的特定設置已被刪除。也就是說,如果啓用了重寫,則不應該看到/index.php。 – isherwood 2013-03-19 15:08:39

回答

0
  1. 使用Joomla的內置功能,可刪除的index.php(全局配置下>網站)

  2. RewriteRule ^streams/(.*)$ http://bruteforce.tv/$1 [R=301,L]我目前的htaccess文件

+0

感謝您的快速答案!當我用前一個代碼替換你的代碼時,它不起作用。或者我可以用htaccess文件的整個代碼替換你的代碼?只是認爲它需要使用RewriteEngine On和RewriteBase /。如果我谷歌oomla功能刪除index.php,它顯示我同樣的事情,我只是做了。在全局設置中啓用URL重寫並將原始htaccess.txt重命名爲.htaccess。 – RobbyBubble 2013-03-19 14:29:15

+0

試着把這一行放在'RewriteEngine on'下面。不要刪除任何其他線路。那些是出於安全原因。 – isherwood 2013-03-19 14:36:41

+0

嗯不起作用。仍然404的 – RobbyBubble 2013-03-19 14:40:37