.htaccess – Two sites on the same server with unwanted redirection

I have two different sites
domain1.com
domain2.com

Problem : I only can access domain2.com by using www.domain2.com
If i try domain2.com it redirects to domain1.com.

Configuration files:
domain1.com.conf

  <VirtualHost *:80>     
     ServerName domain1.com
     ServerAlias www.domain1.com
     DocumentRoot /var/www/html
   </VirtualHost>
   <IfModule mod_ssl.c>
     <VirtualHost *:443>
       DocumentRoot /var/www/html
       ServerName www.domain1.com
       Include /etc/letsencrypt/options-ssl-apache.conf
       SSLCertificateFile /etc/letsencrypt/live/domain1.com/fullchain.pem
       SSLCertificateKeyFile /etc/letsencrypt/live/domain1.com/privkey.pem
     </VirtualHost>
   </IfModule>

domain2.com.conf

   <VirtualHost *:80>
           ServerName domain2.com
           ServerAlias www.domain2.com
           DocumentRoot /var/www/public_html/domain2.com/wordpress
   </VirtualHost>
   <IfModule mod_ssl.c>
   <VirtualHost *:443>
           ServerAdmin gneri94@gmail.com
           DocumentRoot /var/www/public_html/domain2.com/wordpress
           ServerName www.domain2.com
           Include /etc/letsencrypt/options-ssl-apache.conf
           SSLCertificateFile /etc/letsencrypt/live/domain2.com/fullchain.pem
           SSLCertificateKeyFile /etc/letsencrypt/live/domain2.com/privkey.pem
   </VirtualHost>
   </IfModule>

.htaccess in both sites

# BEGIN WordPress                         
  RewriteEngine On 
  RewriteBase / 
  RewriteRule ^index.php$ - [L] 
  RewriteCond %{REQUEST_FILENAME} !-f 
  RewriteCond %{REQUEST_FILENAME} !-d 
  RewriteRule . /index.php [L] 

command certbot certificates returns:

Certificate Name: domain1.com
Domains: domain1.com www.domain1.com
Certificate Path: /etc/letsencrypt/live/domain1.com/fullchain.pem
Private Key Path: /etc/letsencrypt/live/domain1.com/privkey.pem

Certificate Name: domain2.com
Domains: domain2.com www.domain2.com
Certificate Path: /etc/letsencrypt/live/domain2.com/fullchain.pem
Private Key Path: /etc/letsencrypt/live/domain2.com/privkey.pem

javascript – Viewing data from local storage displays everything and unwanted data stored there

I have this list of names, if they click on a name, it should save it to local storage and displayed in another page retrieved from local storage.

  • Liam
  • Noah
  • William
  • James
  • Oliver
  • Benjamin
  • Elijah
  • Lucas

JavaScript

$(document).ready(function() {
$( 'ul.namelist li' ).on( "click", function() {   
   var name = ( $( this ).text() );  
   var last = "";
   var c = localStorage.setItem(name,last);     
   });
})

$(document).ready(function() {
display(); 
})

function display (){
var display_data = document.getElementById('display_data');
display_data.innerHTML="";
for (var i = 0; i < localStorage.length; i++){
var a = localStorage.key(i);
var b = localStorage.getItem(a);
display_data.innerHTML += a+""+b+"
"; } } function clear(){ localStorage.clear(); location.reload(); }

It works, but it also displays everything that is stored in local storage, not just the names selected from the list. Please help, learn JS.

CSF now blocks all VPN connections. How do I turn off this unwanted feature?

For years, I have used CSF without a problem. However, in the past 6 to 12 months, all VPN connections are blocked, because in, I cannot access FTP or SSH on any VPN when CSF is enabled.

I finally understood the problem with certainty by disabling CSF on my server and trying again and I can instantly connect to FTP or SSH via a VPN connection.

Reactivate CSF and cannot immediately access the server via FTP or SSH over a VPN. The problem is 100% guaranteed with CSF and CSF only. Multiple servers with the same problem.

I can connect to cpanel / WHM fine on the same connection, so the IP is not blocked by my server. The problem is that CSF is blocking all VPN connections. I don't know why or how it does it, so I don't know how to disable CSF to block all VPN connections. I need to disable this feature without disabling CSF.

I don't want to temporarily allow a certain IP. I want to disable the CSF VPN blocking feature. I don't care about any security issues. What matters to me is not to lock VPN on the server.

It is a dedicated server with full root access using the latest cpanel / whm and csf on centos 7.

My XML sitemap contains unwanted content, unlike the HTML sitemap. What can I do?

My website has just recovered from an attack. I see that my XML sitemap still contains spam content:


http://xn--qucu-hr5aza.com/7pwclknq****hux0rx.so
2020-04-13
daily


http://xn--qucu-hr5aza.com/a0***u
2020-04-13
daily


http://xn--qucu-hr5aza.com/mp412******msm2ayay
2020-04-13
daily

However, my HTML sitemap is clean.

I am using the Google Sitemap Generator (XML) for WordPress, but there is no "refresh" or "reindex" button.

Is there a way to handle this? And why can the attacker modify my sitemap? Assuming they don't have my FTP password.

Google Search Console always reports unwanted keywords on our site even after cleaning up a hack

Just before the previous Christmas, our website was hacked and our Christmas present consisted of files placed on our server and a redirect to an online pharmacy selling viagra! Merry Christmas to us! Fortunately, we found out a few days after that happened, so all of the files were deleted as well as the redirect files. We also purchased security software and everything seemed to be back to normal, except that our traffic remained low.

However, recently we discovered on our Google Search Console under the Link tab and then on the main anchor from external links (my Google console is in Portuguese, so maybe it doesn't translate exactly like that …) that the word "viagra" is the third most popular link term listed … Now how bad is it? We have exported the list of external links and found a number of links with "viagra" … I don't know yet if these link pages are still online, because I haven't checked all of them yet.

Do you think it still negatively affects our website? How to delete this word "viagra" from our Google console?

javascript – onSubmit makes unwanted URL change

I use ReactJS. I have a form, and "onSubmit" of this form, I want to get the content of the form and then redirect to another page. This kind of work, except that it changes my URL which I don't want. What I want it to redirect to:

localhost: 3000 / somewebsite

but instead, it becomes:

localhost: 3000 / somewebsite? input-form1 = hello & input-form2 = hi

Here's what my code looks like:

I receive unwanted entries in my database from bots

I get unwanted values ​​in my database from bots, with the address of 3137 laguna street and the PIN code of 94102.

per minute i get 30 records, how can i fix it, i already use google recaptcha

Eliminate unwanted "hills" in navmesh on flat ground

So in the image below, you can see that my navmesh contains these strange hills. Is it possible to delete them? My AI is stuck on them.

Weird Spike d:

Problems with unwanted iOS calendar notifications from shared Gmail calendars

Phone: iOS 13.3, iPhone X, application: iOS calendar, GMAIL calendars

I work in a company with a lot of shared calendars (quite common). I don't know when, but in the past half year (mid 2019+), my iOS calendar has started notifying me of others' events in their calendars.

I went to Settings -> Notifications -> Calendar and set:

Upcoming events: on
Invitations off
Invitee responses: off
Shared calendar changes: off
Siri found in apps: off
Notification grouping: by App

In the Calendar app, I only display my own calendar and on each of the shared calendars, by clicking on the info icon, I made sure that the notification of each shared calendar is disabled.

I don't get all notifications from all other shared calendars all the time … I just get random notifications from other people's calendars. I have reset my phone several times. I really don't know what to do next.

Does anyone else have this problem and / or have suggestions. It makes me a little crazy.

Cheers, RB

data structures – Is this a misleading or unwanted implementation of a hash card?

I have read a C ++ implementation of a hash map here.
https://www.geeksforgeeks.org/implementing-hash-table-open-addressing-linear-probing-cpp/

Let's say the key k1 has a hash index of h. Suppose there is a collision with the key k2 such as hash(k1) == hash(k2). The new hash index of k2 to become h+1?

Key: k1     Index: h
Key: k2     Index: h+1

Suppose we introduce a third key k3 such as hash(k3) == h+1. Then when we insert k3 in the hash map, its hash index will become h+2.

Key: k1    Hash value: h      Hash table index: h
Key: k2    Hash value: h      Hash table index: h+1
Key: k3    Hash value: h+1    Hash table index: h+2   

This can cause the key hash indexes to shift to 1 in the event of collisions (as noted above), and if collisions occur frequently, they can be offset more than once.

Is this a bad hash card implementation? From an aesthetic point of view, I prefer the tied approach, where each hash node has a pointer to a next node, so that if multiple nodes have the same hash index, they are all part of the same linked list starting with this hash index.

In the linked approach, at least we have the assurance that a key will logically correspond to its hash index in the hash table, even if it is part of a linked list (to which case it does not correspond physically, but the rest logically, since the head of the linked list is stored there).

Is the implementation of the hash map in GeeksForGeeks bad? Is the linked approach more logical and intuitive? What are your thoughts?

Note: The linked approach that I am referring to is simply to store a list linked to each hash index in the hash table, so that if multiple keys are hashed at that index, they are stored in that linked list.