1
我有这个网站具有以下结构我怎样才能重定向仅主文件
site
|-- .htaccess
|-- index.php
|-- other files and directories
index.php
文件用于每重定向。我如何才能使用修改.htaccess
只有当有人想要访问mydomain.com
而不是当有人使用mydomain.com/otherlink
或mydomain.com/index.php?stuff
时重定向到mydomain.com/desiredLink
?
当前的.htaccess内容如下:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|resources|assets|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
这似乎是工作的罚款。谢谢。 – codiac 2015-03-02 12:23:27
不客气,很高兴它解决了。 – anubhava 2015-03-02 12:25:32