DarkNinja Publish time 2015-05-21 09:16

Problem while enabling SEO - wrong .htaccess code

Edited by DarkNinja at 2015-5-21 09:18

I have enabled SEO for all pages by going to Admin CP > Global > SEO. Then clicked on "View current rewrite rules" and copied all the content under my host (Apache, Virtual host). Then created a new file .htaccess in the root directory of my host and pasted all the code in this file. But after saving it, when I try to access my site, I get internal 500 error. Here is the code that I have pasted in the file:
# Enable RewriteEngine module
RewriteEngine On
# Modify the following statement for real
discuz directory at your server, if the Discuz
is installed at the root, change to "/"
RewriteBase /discuz
# Rewrite rules, do not modify the system
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^topic-(.+)\.html$ portal.php?
mod=topic&topic=$1&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^article-(+)-(+)\.html
$ portal.php?mod=view&aid=$1&page=$2&%
1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^forum-(\w+)-(+)\.html$
forum.php?mod=forumdisplay&fid=$
1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^thread-(+)-(+)-(
+)\.html$ forum.php?mod=viewthread&tid=$
1&extra=page\%3D$3&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^group-(+)-(+)\.html$
forum.php?mod=group&fid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^space-(username|uid)-(.+)
\.html$ home.php?mod=space&$1=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^blog-(+)-(+)\.html$
home.php?mod=space&uid=$1&do=blog&id=$
2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^archiver/(fid|tid)-(+)
\.html$ archiver/index.php?action=$
1&value=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(+*)-(+)\.html$ plugin.php?id=$1:$2&%1

Pme Publish time 2015-05-21 14:01

RewriteBase /discuz

Change it

rameshkiran114 Publish time 2015-05-21 18:20

Edited by rameshkiran114 at 2015-5-21 20:22



Try this Bro~
it contain 404 Error page. You can edit it as you like. :)

DarkNinja Publish time 2015-05-22 08:26

static/image/common/user_online.gif Pme static/image/common/clock.gif 2015-5-21 14:01
RewriteBase /discuz

Change it

I also tried by changing it to

RewriteBase /

DarkNinja Publish time 2015-05-22 08:41

static/image/common/user_online.gif rameshkiran114 static/image/common/clock.gif 2015-5-21 18:20
Try this Bro~
it contain 404 Error page. You can edit it as you like.

I didn't understand this bro. I am getting a 500 internal error.

DarkNinja Publish time 2015-05-22 08:46

Check These Screen shots ...

vot Publish time 2015-05-23 19:36

I'm viewing the first post...
I see the code is wrong because of invalid line wrapping.

1) What the subfolder your Discuz was installed?
2) Please attach the REAL .htaccess file created from the firat post.
Pages: [1]
View full version: Problem while enabling SEO - wrong .htaccess code