Hot answers tagged

4

I seem to have resolved this by explicitly adding the socket to the $wgDBserver variable in LocalSettings.php. To get the socket path, I ran this query in Sequel Pro: show variables like 'socket' The only result was the following: /Applications/MAMP/tmp/mysql/mysql.sock So I changed the variable as follows: $wgDBserver = "localhost:/Applications/MAMP/...


4

Short answer: That PHP code is run on the server before sending the response to the crawler, so by the time the page reaches the crawler, all that info is already populated. For sites written using server-side languages such as your example, here's the full lifecycle when a user visits a page: The user's browser sends an HTTP request to the server for a ...


3

This has to do with how Cloudflare connects to servers. Although it does serve the client via HTTP2 (or HTTP3), it still connects to the server itself via HTTP1.1. Cloudflare only uses HTTP/1.x between the origin web server and Cloudflare. https://support.cloudflare.com/hc/en-us/articles/200168076-Are-the-HTTP-2-or-SPDY-protocols-supported-between-...


2

As has already been mentioned in @closetnoc's answer, the proposed new URL format is preferable to the old one using a .php extension. However, the real question I think here is whether you should "change" the existing URL structure. There is no direct SEO benefit of changing the URL. There is an inherent SEO risk in changing any URL structure. (Google ...


2

I prefer /product/ to product.php. Why? Because it is not file dependent. What if you want to change the file name? Or temporarily use another page for a promotion? Because you could, assuming Apache, change which file is the default page using .htaccess, you can simply and quickly create an .htaccess page in the /product/ directory to point to any page you ...


2

Because your rules conflict... RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^\.]+)$ $1.php [NC] Your first rule matches a request of the form /username and rewrites this to username.php, before your second rule gets a chance to see the request. username.php does not match your second rule. One way to avoid this ...


2

What I do for pages that I want to mark as canonical is put the following code in my header.php file that is loaded on each page: <link rel='canonical' href='<?php echo 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>'> This loads the prefix https:// plus the domain www.example.com plus the page page.php resulting in <link ...


2

Well... I fixed it! But as it usually goes, I'm unsure of the exact thing that put it together. However, I will leave what I did over here, in hopes that it might help someone else in the future. From cPanel, I first changed my php version from 7.2 to 7.1. And it crashed my website. Therefore, I changed it back to 7.2, and voila! It simply works.


2

It means that you should remove/destroy all traces of the person when they log out or the browser (or tab) is closed (if possible). You don't want the next person to sit down at the computer to have hint of what the last person was doing or see anything that belongs to them.


2

I have discovered that you can specify the version of PHP that cron should use like so: /opt/php56/bin/php -q /home/userna5/public_html/testcron.php thanks to this tutorial. All is now working as desired.


2

It depends if your PHP content is really dynamic or not (like, it has a lot for before-render queries to multiple databases or so), but usually there's no substantial difference. Usually what weights more in a website are images (you should compress, gzip and cache those, for sure), scripts and styles. Those last two you may also want to minify and/or uglify,...


2

So, is a redirect to another page with 410 code fine? A redirect is not necessary. Define a custom 410 error document: ErrorDocument 410 /error-docs/e410.php And trigger the 410 in .htaccess, as you did before: RewriteRule ^deleted/ - [G] The G flag is simply a shortcut for R=410 and the L flag is not required (it is implied when using a status code ...


2

There is no difference in PHP or JavaScript for example; except that, with the brackets, it is easier to add instructions later without breaking your code (you are less likely to forget to add the brackets that become mandatory).


2

First, click and submit events first on the submit button and form. These can trigger JavaScript which can completely change or replace the next step. Then an HTTP request is made (using the method specified in the form's method attribute) to the URL specified in the form's action attribute. The server receives the request and processes it. This might ...


2

I was able to solve the whole problem by changing my .htaccess file from # php -- BEGIN cPanel-generated handler, do not edit # Set the “ea-php72” package as the default “PHP” programming language. <IfModule mime_module> AddHandler application/x-httpd-ea-php72 .php .php7 .phtml </IfModule> # php -- END cPanel-generated handler, do not edit to &...


1

There are actually several places in the code you've posted that could trigger a "500 error" (or rewrite-loop), depending on the URL being requested (which you've not stated) and the filesystem structure (which you've not stated). However, the following directive is your most immediate concern: RewriteRule . /post.php This will result in a ...


1

A page that returns a 410 status code will be dropped from Google's index very shortly after Googlebot re-crawls it, even "a little bit faster than a 404" according to Mueller from Google. However, to me it seems like you are using the 410 Gone status code incorrectly. If the pages "still have full content", then they aren't really gone! ...


1

You can configure lighttpd to run multiple fastcgi servers and to send traffic to one or the other based on conditions. fastcgi.server += ( ".php" => (( "host" => "127.0.0.1", "port" => "9001", "broken-scriptfilename" => "enable" )) ) $HTTP["host"] == "dev.mydomain.net"{ ...


1

you are still linking to the URL that contains /_? ... yes but whenever user tries to go to link onclick event ,in new tab he see the _/ in it Regardless of whether we implement a redirect in .htaccess to "fix" this, you do still need to physically remove the /_ part from the URLs in the HTML source that the users click on. Otherwise, they are not "hidden"...


1

If you want to use htaccess, you can use the http header X-Robots-Tag: noindex to accomplish what you need for the specific files you need, or with a pattern. You can also provide other instructions, such as noarchive, nofollow, or even be specific for a particular crawler, for example Googlebot: X-Robots-Tag: googlebot: nofollow X-Robots-Tag: otherbot: ...


1

Facebook doesn't have to have good SEO. Facebook doesn't need to have lots of content in various languages indexed in Google. If you need to be listed in search engines, don't try to emulate Facebook. Google doesn't really support crawling and indexing several languages at the same URL. A few years ago Google announced that Googlbot was going to start ...


1

RewriteCond %{REQUEST_FILENAME} !^/PhP/?$ RewriteCond %{REQUEST_FILENAME} !^/forms/?$ RewriteCond %{REQUEST_URI} !^/PhP/?$ RewriteCond %{REQUEST_URI} !^/forms/?$ You don't need to check against both REQUEST_FILENAME and REQUEST_URI - you're just repeating the same check. It's easier to use REQUEST_URI (the URL-path) in this instance. The ...


1

To remember your logged in state a site needs to send some data to the browser that the browser then sends back on the next request to show they are logged in. This data is usually stored in a cookie. If you select "remember me" the cookie will be set to expire some time in the future, so if you return within that time you'll be remembered, otherwise it's ...


1

Check your .htaccess for the redirections. I suppose it is an internal redirection made by WordPress. You can try this in the .htaccess. Make sure to have mod_rewrite activated in your server. RewriteEngine On RewriteCond %{HTTP_HOST} ^example.com$ RewriteCond %{HTTPS} off RewriteRule ^(.*) https://www.example.com/$1 [QSA,L,R=301]


1

As an alternative, you can also try the following. It should work with MAMP for Mac with default MAMP Ports (e.g., 8889 for MySQL). If you personalized the ports, put the corresponding one for MySQL Port: Edit LocalSettings.php Search for line starting with $wgDBserver Replace variable so the whole line looks like as follows: $wgDBserver = "127.0.0.1:...


1

You will have to adjust the user/group permissions behind the scenes. Here is the guide the default user and group permissions that are installed on the stock API. MediaWiki Help:User rights and groups You may have to work in reverse with the stock permissions by hiding / restricting features to the “all” group then allowing the features to the “users” ...


1

I got exactly same problem when deploy HA Wordpress on EC2 Apache web server under auto scaling group when spin up new EC2 Apache web server. 1. At first I think there are problem with apache web server: sudo vim /var/log/httpd/error_log [Tue Nov 05 ] [core:notice] [pid 2914] AH00094: Command line: '/usr/sbin/httpd' [Tue Nov 05 ] [mpm_prefork:notice] [pid ...


1

You can absolutely create web pages with firebase. Check out Firebase Hosting, it lets you serve up static websites HTML, CSS, and JS, which are inherently SEO-friendly. You can couple this JAMstack approach with Firebase's storage, database and authentication tools to make a first-class app. I'm not sure how practical it is compared to a standard dynamic ...


1

Google AdSense also requires an ads.txt file for your website. If you go login to the AdSense site it will tell you if this is the cause of your error.


Only top voted, non community-wiki answers of a minimum length are eligible