Php 错误404:我的网站上的链接不';t工作,仅索引(使用Codeigniter&;htaccess)

Php 错误404:我的网站上的链接不';t工作,仅索引(使用Codeigniter&;htaccess),php,apache,.htaccess,codeigniter,routing,Php,Apache,.htaccess,Codeigniter,Routing,我在Apache服务器上托管我的网站。它是用PHP框架Codeigniter创建的。我只能看到主页,其他什么都看不到,链接不起作用 如果我想转到http://tstspanama.com/servicios,我得到: 找不到 在此服务器上找不到请求的URL/servicios 有人知道我该如何解决这个问题吗?我附上所有重要的代码 关于应用程序配置(/var/www/tsts/application/config/config.php) 在我的.htaccess上 <IfModule mod

我在Apache服务器上托管我的网站。它是用PHP框架Codeigniter创建的。我只能看到主页,其他什么都看不到,链接不起作用

如果我想转到
http://tstspanama.com/servicios
,我得到:

找不到

在此服务器上找不到请求的URL
/servicios

有人知道我该如何解决这个问题吗?我附上所有重要的代码

关于应用程序配置(/var/www/tsts/application/config/config.php)

在我的.htaccess上

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteBase /tsts/
    RewriteCond $1 !^(index\.php|assets|images|css|js|robots\.txt)
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php/$1 [QSA,L]
</IfModule>

<IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    ErrorDocument 404 /index.php
</IfModule>

<ifModule mod_php5.c>
    php_value default_charset utf-8
</ifModule>

php_flag display_startup_errors on
php_flag display_errors on
php_flag html_errors on

重新启动发动机
重新编写基本/tsts/
1美元^(索引\.php |资产|图像| css | js | robots\.txt)
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_FILENAME}-F
重写规则^(.*)$index.php/$1[QSA,L]
#如果我们没有安装mod_rewrite,所有404
#可以发送到index.php,一切正常。
ErrorDocument 404/index.php
php_值默认_字符集utf-8
php_标志显示_启动_错误
php_标志显示上的错误
上的php_标志html_错误
On/etc/apache2/sites available/www.tststspanama.com

<VirtualHost *:80>
    ServerName www.tstspanama.com
    ServerAlias tstspanama.com

    DocumentRoot /var/www/tsts
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>

    <Directory /var/www/tsts>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
    </Directory>

    ErrorLog /var/log/apache2/error.log
    # Possible values include: debug, info, notice, warn, error,
    # crit, alert, emerg.
    LogLevel error
    CustomLog /var/log/apache2/access.log combined
    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>
</VirtualHost>

服务器名www.tstspanama.com
ServerAlias tspanama.com
DocumentRoot/var/www/tsts
选项如下符号链接
不允许超限
选项索引跟随符号链接多视图
不允许超限
命令允许,拒绝
通融
ScriptAlias/cgi-bin//usr/lib/cgi-bin/
不允许超限
选项+执行CGI-多视图+符号链接所有者匹配
命令允许,拒绝
通融
ErrorLog/var/log/apache2/error.log
#可能的值包括:调试、信息、通知、警告、错误、,
#暴击,警戒,紧急。
日志级错误
CustomLog/var/log/apache2/access.log组合
别名/doc/“/usr/share/doc/”
选项索引多视图跟随符号链接
不允许超限
命令拒绝,允许
全盘否定
允许从127.0.0.0/255.0.0.0::1/128开始

< /代码> 如果添加<代码>改写为基础/代码>,URL考虑它,因此删除它或使用<代码> /< /代码>:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteBase /
    RewriteCond $1 !^(index\.php|assets|images|css|js|robots\.txt)
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php/$1 [QSA,L]
</IfModule>

<IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    ErrorDocument 404 /index.php
</IfModule>

<ifModule mod_php5.c>
    php_value default_charset utf-8
</ifModule>

php_flag display_startup_errors on
php_flag display_errors on
php_flag html_errors on

重新启动发动机
重写基/
1美元^(索引\.php |资产|图像| css | js | robots\.txt)
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_FILENAME}-F
重写规则^(.*)$index.php/$1[QSA,L]
#如果我们没有安装mod_rewrite,所有404
#可以发送到index.php,一切正常。
ErrorDocument 404/index.php
php_值默认_字符集utf-8
php_标志显示_启动_错误
php_标志显示上的错误
上的php_标志html_错误

以后,不要用图片代替错误信息或代码。此网站的搜索引擎仅为文本编制索引。已编辑。我实际拥有的是
RewriteBase/tsts/
。我为什么要改变它?我不太明白它是如何工作的。如果你的.htaccess存在于index.php的同一个目录中,那么它不是必需的<代码>重写库
为路径添加前缀。换句话说,当您尝试加载并且您有了
RewriteBase/tsts/
,apache尝试从当前目录+
/tsts/
文件夹加载index.php。你要试试吗?
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteBase /
    RewriteCond $1 !^(index\.php|assets|images|css|js|robots\.txt)
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php/$1 [QSA,L]
</IfModule>

<IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    ErrorDocument 404 /index.php
</IfModule>

<ifModule mod_php5.c>
    php_value default_charset utf-8
</ifModule>

php_flag display_startup_errors on
php_flag display_errors on
php_flag html_errors on