| |
| | |

CodersClub

 Forgot password?
 Register
Search
View: 6236|Reply: 6
Collapse the left

Problem while enabling SEO - wrong .htaccess code

[Copy link]
Post time: 2015-05-21 09:16 From the mobile phone
| Show all posts |Read mode
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:
  1. # Enable RewriteEngine module
  2. RewriteEngine On
  3. # Modify the following statement for real
  4. discuz directory at your server, if the Discuz
  5. is installed at the root, change to "/"
  6. RewriteBase /discuz
  7. # Rewrite rules, do not modify the system
  8. RewriteCond %{QUERY_STRING} ^(.*)$
  9. RewriteRule ^topic-(.+)\.html$ portal.php?
  10. mod=topic&topic=$1&%1
  11. RewriteCond %{QUERY_STRING} ^(.*)$
  12. RewriteRule ^article-([0-9]+)-([0-9]+)\.html
  13. $ portal.php?mod=view&aid=$1&page=$2&%
  14. 1
  15. RewriteCond %{QUERY_STRING} ^(.*)$
  16. RewriteRule ^forum-(\w+)-([0-9]+)\.html$
  17. forum.php?mod=forumdisplay&fid=$
  18. 1&page=$2&%1
  19. RewriteCond %{QUERY_STRING} ^(.*)$
  20. RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]
  21. +)\.html$ forum.php?mod=viewthread&tid=$
  22. 1&extra=page\%3D$3&page=$2&%1
  23. RewriteCond %{QUERY_STRING} ^(.*)$
  24. RewriteRule ^group-([0-9]+)-([0-9]+)\.html$
  25. forum.php?mod=group&fid=$1&page=$2&%1
  26. RewriteCond %{QUERY_STRING} ^(.*)$
  27. RewriteRule ^space-(username|uid)-(.+)
  28. \.html$ home.php?mod=space&$1=$2&%1
  29. RewriteCond %{QUERY_STRING} ^(.*)$
  30. RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$
  31. home.php?mod=space&uid=$1&do=blog&id=$
  32. 2&%1
  33. RewriteCond %{QUERY_STRING} ^(.*)$
  34. RewriteRule ^archiver/(fid|tid)-([0-9]+)
  35. \.html$ archiver/index.php?action=$
  36. 1&value=$2&%1
  37. RewriteCond %{QUERY_STRING} ^(.*)$
  38. RewriteRule ^([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ plugin.php?id=$1:$2&%1
Copy the Code


 Turkey

Post time: 2015-05-21 14:01
| Show all posts
RewriteBase /discuz

Change it
Post time: 2015-05-21 18:20
| Show all posts
Edited by rameshkiran114 at 2015-5-21 20:22



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

This post contains more resources

You have to Login for download or view attachment(s). No Account? Register

x
 Author| Post time: 2015-05-22 08:26 From the mobile phone
| Show all posts
Pme 2015-5-21 14:01
RewriteBase /discuz

Change it

I also tried by changing it to

RewriteBase /
 Author| Post time: 2015-05-22 08:41 From the mobile phone
| Show all posts
rameshkiran114 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.
 Author| Post time: 2015-05-22 08:46 From the mobile phone
| Show all posts
Check These Screen shots ...

This post contains more resources

You have to Login for download or view attachment(s). No Account? Register

x

 Russia

Post time: 2015-05-23 19:36
| Show all posts
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.
You have to log in before you can reply Login | Register

Points Rules

Archive|Mobile|Dark room|CodersClub

Top.Mail.Ru
Top.Mail.Ru

2024-05-03 23:45 GMT+3 , Processed in 0.079605 sec., 9 queries .

Powered by Discuz! X3.4 Release 20230520

© 2001-2024 Discuz! Team.

MultiLingual version, Rev. 4301, © codersclub.org

Quick Reply To Top Return to the list