我即将把 mod_rewrite 踢到路边。谈论“不和别人打得很好”。有没有任何巫医可以帮助我解决这个问题?
我设置了通配符 dns 来识别用户。我想从:
http://username.domain.com/foo/bar
到:
https://www.domain.com/qux/waldo/username/foo/bar
这可能吗?
我正在使用 codeigniter 进行开发,它已经在 .htaccess 中有自己的 mod_rewrite 指令,以去除 index.php。
这是我所拥有的:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} ^(www\.)?[^.]+\.idseal\.local.*$
RewriteRule (.*) /site/assign/$1
#Removes access to the system folder by users.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>