0

I work with wordpress, and I wanted to change my permalink from "default" to "post name". After I changed it, I got a 404 error from Apache. Then I searched and got this: WordPress permalink structure change issue. When I write this command "sudo a2enmod userdir" and refresh my page, I get a 500 error:

Internal Server Error 
The server encountered an internal error or misconfiguration and was
unable to complete your request. Please contact the server
administrator at webmaster@localhost to inform them of the time this
error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.

Here is my server log error:

127.0.0.1:45292] /var/www/tvvarzesh.dev/public_html/.htaccess: 
Invalid command 'BEGIN', perhaps misspelled 
or defined by a module not included in the server configuration
  • Please keep in mind that asking questions is not like chatting with friends: Use upper and lower case characters. Thanks. – kaiser Oct 8 '14 at 10:55
3
  1. You might have edited your .htaccess file in Windows notepad or text editor. If you did use Windows text editor then it must have added some special chars in .htaccess file and that will lead to 500 internal server error. Never edit in Windows text editor.

Use notepad++ for editing .htaccess and .htpasswd files.

  1. second thing you should try is open your .htaccess file and put a # in front of BEGIN WordPress. Like this.

    # BEGIN WordPress
    

and there should be a line also. like this.

    # END WordPress

If you still have issues or you don't understand then paste your .htaccess file content here in your question by editing it.

  • 3
    Glad I could help. If this solves your issue, don't forget to accept it. :) – Robert hue Oct 8 '14 at 8:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.