页面未找到错误PHP

时间:2016-08-03 12:36:06

标签: php .htaccess

我在服务器主页上更新了我的网站工作正常,但内页工作不正常

 home page url-http://54.174.90.227/  - working
 innerpage url-http://54.174.90.227/advertise/  - not working

我检查了我的.htaccess文件 RewriteEngine已开启

     # enable apache modRewrite module #
     RewriteEngine on

     AddDefaultCharset utf-8

     #Protect - DOS
       LimitRequestBody 10000000

      # set files headers
     <IfModule mod_headers.c>
      <FilesMatch "\.(css|js|png|gif|jpg|jpeg|htc)$">
      Header set Cache-Control "max-age=2678400, public, must-revalidate"
     </FilesMatch>
     </IfModule>

   <IfModule mod_headers.c>
    <filesMatch "(thumb_resize\.php|thumb_resize_fixed\.php|image_url\.php)$">
     Header set Cache-Control "max-age=2678400, must-revalidate"
    </filesMatch>
     </IfModule>

        #+SymLinksIfOwnerMatch
      Options All -Indexes

  <Files .htaccess>
  order allow,deny
  deny from all
  </Files>

  # deflate static content
   <IfModule mod_deflate.c>
 AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/x-component 

  text/css application/x-javascript application/javascript

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f

  ErrorDocument 403 "/public/error/404.php/"
   ErrorDocument 404 "/public/error/404.php/"
 ErrorDocument 406 "/public/error/404.php/"


# Pages User
 RewriteRule ^([a-zA-Z0-9-\_\.]+)$ index.php?usr=$1 [QSA,L]

# Pages Search
RewriteRule ^search/(.+)$ index.php?q=$1 [QSA,L]

 # Pages Static
RewriteRule ^([a-zA-Z0-9-_]+)/$ index.php?page=$1 [QSA,L]

# Pages Status
 RewriteRule ^([a-zA-Z0-9-_]+)/(status)/([0-9]+)$ index.php?   usr=$1&action=$2&id_status=$3 

[QSA,L]

  # Pages User Action
 RewriteRule ^([a-zA-Z0-9-\_\.]+)/(followers|following|favorites|media|info)$ index.php?usr=

$1&action=$2 [QSA,L]

#Thumb Resize Images
RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^thumb/([a-z0-9-_\.\/]+)$ thumb_resize.php?x=$1 [QSA,L]

 #Thumb Resize Images Fixed
RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^thumb_fixed/([a-z0-9-_\.\/]+)$ thumb_resize_fixed.php?x=$1 [QSA,L]

#sitemaps
RewriteRule ^public/sitemaps/sitemaps\.xml$ public/sitemaps/sitemaps.php [L]

请建议我。

1 个答案:

答案 0 :(得分:0)

尝试通过递减或递增项目来测试它。

您将备份.htaccess并删除此内容。然后尝试,如果基本网址正在工作,并且如果广告的网址正在运行。我想,两个url都会正常工作。 然后,您将逐个添加来自备份.htaccess的规则,并观察它何时会中断。然后你有了规则,这打破了你的网页。

接下来让我们看一下httpd.conf和其他类似的apache配置文件。检查您的DocumentRoot变量,如果尚未将Alias设置为广告目录,请检查。

接下来检查advertise目录是否在/var/www/html目录中?因此,广告文件必须位于/var/www/html/advertise目录中。

advertise目录index.php