我有一個非常簡單的RewriteRule,但我不明白爲什麼它不想工作。也許它只是疲憊的說話,但有些似乎不可思議。爲什麼這個RewriteRule與[R]一起使用,但不與[QSA,L]一起使用?
我想將看起來像http://mydomain.com/abc
的網址重定向到http://mydomain.com/abc/index.php/xyz
,但我不希望URL更改。
這是我的全部的.htaccess:「沒有指定輸入文件」
RewriteEngine On
RewriteBase /abc/
#redirect the homepage
RewriteRule ^$ index.php/msj [QSA,L]
當我這樣做,我得到。如果我將[QSA,L]更改爲[R],它會起作用,但它實際上會重定向URL。
我誤解了什麼?
編輯:爲$ _ SERVER
array(34) { [
"PATH"]=> string(29) "/bin:/usr/bin:/sbin:/usr/sbin" [
"RAILS_ENV"]=> string(10) "production" [
"FCGI_ROLE"]=> string(9) "RESPONDER" [
"UNIQUE_ID"]=> string(24) "UxDcvK3suH0AABgWvXUAAAAj" [
"SCRIPT_URL"]=> string(1) "/" [
"SCRIPT_URI"]=> string(22) "http://themspress.org/" [
"dsid"]=> string(8) "25793844" [
"ds_id_25793844"]=> string(0) "" [
"DH_USER"]=> string(13) "juancommander" [
"HTTP_HOST"]=> string(14) "themspress.org" [
"HTTP_CONNECTION"]=> string(5) "close" [
"HTTP_ACCEPT"]=> string(74) "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8" [
"HTTP_USER_AGENT"]=> string(120) "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36" [
"HTTP_ACCEPT_ENCODING"]=> string(17) "gzip,deflate,sdch" [
"HTTP_ACCEPT_LANGUAGE"]=> string(23) "en-US,en;q=0.8,es;q=0.6" [
"HTTP_COOKIE"]=> string(190) "OJSSID=Siy7xdofJurGtBcNUk1880; __utma=154159997.1153519437.1393351515.1393522373.1393598726.4; __utmc=154159997; __utmz=154159997.1393351515.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)" [
"SERVER_SIGNATURE"]=> string(0) "" [
"SERVER_SOFTWARE"]=> string(6) "Apache" [
"SERVER_NAME"]=> string(14) "themspress.org" [
"SERVER_ADDR"]=> string(15) "173.236.187.201" [
"SERVER_PORT"]=> string(2) "80" [
"REMOTE_ADDR"]=> string(14) "189.138.120.63" [
"DOCUMENT_ROOT"]=> string(51) "/home/juancommander/themspress.org/var/www/html/ojs" [
"SERVER_ADMIN"]=> string(24) "[email protected]" [
"SCRIPT_FILENAME"]=> string(61) "/home/juancommander/themspress.org/var/www/html/ojs/index.php" [
"REMOTE_PORT"]=> string(5) "53719" [
"GATEWAY_INTERFACE"]=> string(7) "CGI/1.1" [
"SERVER_PROTOCOL"]=> string(8) "HTTP/1.1" [
"REQUEST_METHOD"]=> string(3) "GET" [
"QUERY_STRING"]=> string(0) "" [
"REQUEST_URI"]=> string(1) "/" [
"SCRIPT_NAME"]=> string(10) "/index.php" [
"PHP_SELF"]=> string(10) "/index.php" [
"REQUEST_TIME"]=> int(1393614012) }
這是CI還是其他一些框架? – anubhava
其開放期刊系統。它使用PHP。我實際上有另一個安裝在另一臺服務器上有相同的設置(雖然,顯然不完全相同),並在那裏工作... – pocketfullofcheese
是abc一個真正的目錄?你的htaccess文件位於哪個目錄? –