【发布时间】:2013-03-19 22:10:02
【问题描述】:
我需要一个有效的 RewriteRule 来摆脱我的网址中的 /index.php/category/ 部分。
bruteforce.tv/index.php/streams/shinigamily
bruteforce.tv/index.php/streams/cash
bruteforce.tv/index.php/streams/blacktigrex
bruteforce.tv/index.php/streams/viktorwwe
到
bruteforce.tv/shinigamily
bruteforce.tv/cash
bruteforce.tv/blacktigrex
bruteforce.tv/viktorwwe
我不习惯使用 htaccess 文件,所以我很抱歉完全没有资源。
这是我当前的 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]
【问题讨论】:
-
您不使用 Joomla 功能删除 index.php 的任何原因?我会从那开始。
-
我不知道你的意思是什么功能。如果它的 URL 重写,它启用。但因此需要一个 htaccess 文件。
-
我的错误。我忘记了在 2.5 中删除了该特定设置。也就是说,如果启用了重写,您不应该看到 /index.php。
-
有人告诉我“你需要重定向和重写!”。仍然不知道该怎么做:
标签: .htaccess joomla url-rewriting