I messed up my website with the rewrite rules and the vhost conf files. I shoudlnt have touched them, now my website is down

Hello there,

I need some help: I was trying to fix an issue on my Wordpress website. The problem was that some of my pages were returning no padlock “not secure” red icon, when I was typing the address without https://

I am using cyberpanel on oracle free tier, I was trying to fix the problem myself. I was messing with the rewrite rules and the host conf inside the cyberpanel webadmin and now my website cannot be accessed with ERR_TOO_MANY_REDIRECTS. I don’t know what to do. Can anybody tell me how can I resolve this problem? See attached file which files I messed up.

Thanks for your help (server enthusiast here, but not much experience)

p.s. this is what I put in vhost cof file for rewrite, as stated in the web article.
rewrite {
enable 1
rules <<<END_rules
rewriteFile /home/example.com/public_html/.htaccess

copy from another website vhost :smiley:

rewrite rule ? it have template right ?

Yep, I thought about that after, tahnks :slight_smile: and I did. But I am now at the beginning of the problem, still the problem persists.

I lost access to my website when I clicked on rewrite rules and saved the proposed rules.

Now I updated the vhost conf file and I made it as it was in the beginning, but still nothing. Is it some problem with the htaccess file?

How can I get back to the previous state?

what kind of problem are you actually facing?

what do you mean with “lost access” ? CMS username password ? or… else ?

have you made any adjustments to the contents of the vhost ?

you can’t just copy the contents. there are some parts that must be changed such as name123(username)

other solutions, if your website already installer some cms

  1. compress public_html… eg. public.zip
  2. backup the sql
  3. save both file on your pc
  4. delete the website
  5. recreate new website
  6. upload and extract public.zip
  7. create database & username
  8. dumb the sql back.
  9. check your cms config file to gain access to db
1 Like

The website was inaccessible, it showed the error webpage inaccessible ERR_TOO_MANY_REDIRECTS.

But I solved it now. It was a problem in one of the rewrite rules in the Rewrite Rules, I actually needed to add / in the line for one of the three default rules, RewriteRule ^/(.*)$ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Now, not only my website is accessible, but there is no more mixed content! Wooohooo :slight_smile:

Thanks for your help @MyIDKaTePe !

1 Like