doukui4786 2017-09-11 11:10
浏览 24

麻烦.htaccess,网站将无法正常工作

my htaccess file looks like this:

RewriteEngine on
RewriteCond $1 !^(index\.php|assets|img|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]

But when I try to do anything on the website only the main website works ok. If I want to go to login page I'm getting an error:

No input file specified.

But if I change the .htaccess file to:

    RewriteEngine on
RewriteCond $1 !^(index\.php|assets|img|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]

The subpages work, but then I have trouble with the theme...

 --> 404 Page Not Found: Themes/default

Anyone have any idea to what should I change the htaccess file that the page would work. I'm using CodeIgniter.

OK, I've changed the .htaccess to:

RewriteEngine on
RewriteCond $1 !^(index\.php|assets|img|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/?$1 [L,QSA]

Added ? before the $ sign and now the page loads ok. But now I have another problem with the theme.

ERROR - 2017-09-11 06:43:40 --> 404 Page Not Found: Themes/default

Also fix this: Must be the right directory path inside the config file.

  • 写回答

2条回答 默认 最新

  • douduxia1551 2017-09-11 11:16
    关注

    Try it like this :

        RewriteEngine on
    RewriteCond $1 !^(index\.php|assets|img|css|js|robots\.txt|favicon\.ico)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . index.php [QSA, L]
    
    评论

报告相同问题?

悬赏问题

  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程