GoDaddy.htaccess问题-简单修复


GoDaddy .htaccess issues - simple fix

我从codecanyon购买了一个脚本,并安装了其他所有东西,但问题是,由于我认为是.htaccess问题,我一直收到404错误。我在同一台服务器上有过类似的脚本,它总是通过调整.htaccess.来解决

有人对改变什么有什么建议吗?因为这目前不起作用:

RewriteEngine on
RewriteRule ^category/(.*)/(.*)$ category.php?id=$1&slug=$2
RewriteRule ^source/(.*)/(.*)$ source.php?id=$1&slug=$2
RewriteRule ^news/(.*)/(.*)$ news.php?id=$1&slug=$2
RewriteRule ^page/(.*)/(.*)$ page.php?id=$1&slug=$2
RewriteRule ^search/(.*)$ search.php?q=$1
RewriteRule ^not-found$ notfound.php
RewriteRule ^rss.xml$ rss.php
RewriteRule ^sitemap-(.*).xml$ sitemap.php?id=$1
RewriteRule ^categories-sitemap.xml$ categories-sitemap.php

所以我添加了这个

Options +FollowSymLinks -MultiViews -Indexes

现在我的.htaccess:文件如下所示,但仍然无法工作。

Options +FollowSymLinks -MultiViews -Indexes
RewriteEngine on
RewriteRule ^category/(.*)/(.*)$ category.php?id=$1&slug=$2
RewriteRule ^source/(.*)/(.*)$ source.php?id=$1&slug=$2
RewriteRule ^news/(.*)/(.*)$ news.php?id=$1&slug=$2
RewriteRule ^page/(.*)/(.*)$ page.php?id=$1&slug=$2
RewriteRule ^search/(.*)$ search.php?q=$1
RewriteRule ^not-found$ notfound.php
RewriteRule ^rss.xml$ rss.php
RewriteRule ^sitemap-(.*).xml$ sitemap.php?id=$1
RewriteRule ^categories-sitemap.xml$ categories-sitemap.php

我放弃了,正在寻求帮助。当我尝试去一个没有.htaccess重写的链接时,我的帖子会显示

例如,这不起作用:http://rockwallhistoricsquare.com/news/20/stand-off-in-rockwall

然而,这确实有效:http://www.rockwallhistoricsquare.com/news.php?id=20&slug=岩壁中的对峙

我做错了什么?非常感谢您的帮助,谢谢!

DirectoryIndex index.php<br>
AddDefaultCharset utf-8<br>
RewriteEngine on<br>
Options +FollowSymlinks -MultiViews -Indexes
RewriteRule ^category/(.*)/(.*)$ category.php?id=$1&slug=$2
RewriteRule ^source/(.*)/(.*)$ source.php?id=$1&slug=$2
RewriteRule ^news/(.*)/(.*)$ news.php?id=$1&slug=$2
RewriteRule ^page/(.*)/(.*)$ page.php?id=$1&slug=$2
RewriteRule ^search/(.*)$ search.php?q=$1
RewriteRule ^not-found$ notfound.php
RewriteRule ^rss.xml$ rss.php
RewriteRule ^sitemap-(.*).xml$ sitemap.php?id=$1
RewriteRule ^categories-sitemap.xml$ categories-sitemap.php

这工作得很好