2015-10-05 78 views
1

我购买了从codecanyon一个脚本,并安装了一切毫不费力但问题是我不断收到404错误原因是什么,我认为是的.htaccess问题。我在同一台服务器上有类似的脚本,它一直归结为通过调整.htaccess来解决它。GoDaddy的的.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=stand-off-in-rockwall

我在做什么错?非常感谢帮助,谢谢!

+0

此外,什么文件权限应的.htaccess有哪些?我不小心设置一切为777,所以如果这是一个问题,我可以改变这种状况的时候了... –

+0

尝试它自己之后,你重写规则似乎工作得很好。如果您有权访问apache错误日志(您可能不会使用GoDaddy),请检查它 - 它会告诉您apache尝试(并失败)的服务。如果这不能为您提供足够的线索来解决问题,请使用日志更新问题,我们可以提供更多帮助。 – HPierce

+1

嗨@HPierce谢谢你的尝试。那么我错误日志将可用,直到 星期一,2015年10月12日下午2点27分55秒......所以没有访问那里。代码开发人员正在检查我的服务器上的脚本,如果他发现任何问题,我会发布问题,这位开发人员已经知道需要几个月才能回答呃。 –

回答

0
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 

这个作品非常好