Wordpress: redirecting to my old public ip

I started to develop my own wordpress site, that I hosted locally. I am using Apache for hosting and mariaDB for DB. I accessed the site through my public ip, that in my case was was xxx.xxx.1.163. I could also access my site thorugh 127.0.0.1. I set the wordpress site up and everything worked fine. PROBLEM Until I moved from one place to another with my computer. Now I can not access my site anymore. I have been struggling with …
Category: Web

Wordpress Memory limit not increasing

I have set 1024M in php.ini file: memory_limit = 1024M I have set it in .htaccess file: <IfModule mod_php7.c> php_value memory_limit 1024M </IfModule> I have set it in wp-config.php file: define( 'WP_MAX_MEMORY_LIMIT' , '1024M'); define( 'WP_MEMORY_LIMIT', '1024M' ); But I still get the following error on a plugin page in my Wordpress admin area: Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 61440 bytes) in /home/eroticnaughtines/public_html/wp-includes/functions.php on line 4212 And yes, all the files are in …
Category: Web

How to add refund in custom payment gateway woocommerce

I want to add refund to the woocommerce-payment-gateway in class WC_Custom_Gateway extends WC_Payment_Gateway function __construct() { $this->supports = array('products', 'refunds'); $this->id = 'custom'; $this->icon = plugins_url('../assets/custom-logo.png', __FILE__); $this->has_fields = true; $this->method_title = 'Custom'; $this->method_description = 'Payment using Custom card'; $this->init_form_fields(); $this->init_settings(); $this->title = sanitize_textarea_field($this->get_option('title')); $this->description = sanitize_textarea_field($this->get_option('description')); $this->enabled = sanitize_key($this->get_option('enabled')); $this->discount = intval($this->get_option('discount')); $this->token = sanitize_text_field($this->get_option('token')); $this->client = sanitize_text_field($this->get_option('client')); $this->back_url = esc_url_raw($this->get_option('back_url')); $this->response_type = $this->get_option('response_type'); add_action('woocommerce_update_options_payment_gateways_' . $this->id, array($this, 'process_admin_options')); // if (is_admin()) { // add_action('woocommerce_update_options_payment_gateways_' . $this->id, array($this, 'process_admin_options')); …
Category: Web

New wordpress keep redirecting to localhost/wp-admin/install.php

IN my fresh wordpress install via docker. Everytime i hit localhost it gets redirected to http://localhost/wp-admin/install.php Now its missing the wp , the url should be http://localhost/wp/wp-admin/install.php My Env variable is like this WP_ENV=development WP_HOME=http://localhost/wp WP_SITEURL=${WP_HOME}/wp my apache vhost file is <VirtualHost *:80> ServerName http://localhost DocumentRoot ${APACHE_DOCUMENT_ROOT} <Directory ${APACHE_DOCUMENT_ROOT}> AllowOverride all </Directory> CustomLog /var/log/apache2/local-access.log "combined" ErrorLog /var/log/apache2/local-error.log </VirtualHost>
Category: Web

How can i redirect one url to another url using .htaccess or add_rewrite_rule

I am stuck at redirecting one url to another url. I want to redirect https://samedomain.com/page-check-927GSJAYS639AL/highlights to https://samedomain.com/page-highlights/ (927GSJAYS639AL this is id it can be anything) the http://samedomain.com/page-highlights/ is the wordpress page The rewrite rule I tied in .htaccess file (added this in the first line it-self) is: RewriteEngine On RewriteRule ^page-check-([A-Z0-9_-]+)/highlights$ page-highlights?id=$1 [L] but I see a 404 error page It worked for RewriteEngine On RewriteRule ^page-check-([A-Z0-9_-]+)/highlights$ info.php?id=$1 [L] I also tried WP rewrite API php code UPDATE 1 add_action('init', …
Category: Web

Windows Setup: Error establishing a database connection

I have MySQL 8.0.12, PHP v7.3.2 64Bit and Apache 2.4.38 64Bit installed. In theory I have everything that is needed to run WordPress locally. Through MySQL Workbench, I have tried the Host, Port, User and Password I have set up in wp-config.php and I am able to connect without any problems. For some reason however, when I navigate to my site's wp-admin/install.php I get the following: In my hosts file, I have dev.nativeleaf.co.uk set up to point at 127.0.0.1, along …
Category: Web

How can I view my site directly from WordPress dashboard?

Basically, I am using localhost through XAMPP, it has been 2 weeks since I started and and I had to reinstall XAMPP because I was having problems with ports. And now, I just started remaking my website again, using the port '3000' for apache and everything seemed to work fine until I can't even see the changed I have made from the wordpress dashboard or by just writing the domain name in the search bar, what is weird is that, …
Category: Web

Use subdomain for certain urls

I have the following rules in my .htaccess file on a WordPress (single installation): # REWRITE FORUMS DOMAIN TO FOLDER RewriteCond %{HTTP_HOST} ^forums\.example\.com$ RewriteRule !^forums/? forums%{REQUEST_URI} [NC,L] # REWRITE FORUMS FOLDER TO SUBDOMAIN RewriteCond %{THE_REQUEST} \s/forums/([^\s]*) [NC] RewriteRule ^ http://forums.example.com/%1 [R=301,L] This is so that the forums that exist at http://example.com/forums are accessed at http://forums.example.com/ However the server just blows up with a 500 server error... Any ideas on how to do this? These rules work perfectly when used on …
Category: Web

Unable leverage Browser Caching on AWS Bitnami stack (Apache) through W3TC and Cloudfront CDN

I followed many tutorial about leveraging browser caching nevertheless I couldn't configure it succesfully, in fact GTmetric (PageSpeed and YSlow) notified me many static file that don't have a cache expire header. That's my GTmetrix result (pagespeed): I tried to find the problem looking at compatibility test on W3TC and it notified me many Apache modules missed which are required for browser caching: I followed some tutorial to enable these modules but it seems they are alread enabled, in fact …
Category: Web

Localhost WordPress Uploading of Images Issue

I'm a bit stuck here. My Mac (running Mavericks) died on me last week, and I spent the weekend getting a new computer and restoring the backup of my old (thank God for backups people. If you haven't made one, go do it.) The new computer runs Yosemite. I had a pretty great system set up on my old computer that I was REALLY happy with for running local installs of WordPress via a single installation without using WPMU. I …
Category: Web

Override htacces rule only for specific directory

I have a WordPress site with ithemes security installed plugin. I want to disable this rule: RewriteCond %{HTTP_USER_AGENT} "^$" [NC,OR] only for this wp-content/uploads/xmls directory. Relevant (summarised) section of .htaccess file: # Begin HackRepair.com Blacklist RewriteEngine on # Abuse Agent Blocking RewriteCond %{HTTP_USER_AGENT} ^[Ww]eb[Bb]andit [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^$ [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^Acunetix [NC,OR] : : etc. : RewriteCond %{HTTP_USER_AGENT} YisouSpider [NC,OR] RewriteCond %{HTTP_USER_AGENT} zermelo [NC,OR] RewriteCond %{HTTP_USER_AGENT} ZyBorg RewriteRule ^.* - [F,L] # Abuse bot blocking rule end
Category: Web

Redirect from different port to subdomain - htaccess

I created a Digital Ocean instance to install WordPress website 5 days ago. I already have my own domain, and created DNS Subdomain blog.example.com. The server runs both nginx and apache so my Apache port is 8082. Below is what my actual WordPress URL looks like: www.example.com:8082/wordpress/ Something which I have tried is below. <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^(www\.)?example\.com:8082/wordpress\ RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ([a-z0-9-]+)/? http://$1.example.com [R=301,NC,L] </IfModule> Now my expected result is from …
Category: Web

Theme javascript/css 404

I have recently installed WordPress 5.9.2 on my VPS using Apache2 on Debian 11. I want to try some different themes (partially because I think the editor for the new Twenty Twenty-Two theme is clunky and lacks stuff). However I noticed that after changing themes, no styles were loaded leaving an ugly page. Looking into the developed console in Firefox, I saw that I was getting 404 errors when loading any resources. I also noticed that I got the same …
Category: Web

Timthumb isn't displaying any images. "A TimThumb error has occured

I have a Wordpress web site which is hosted on a distributed infrastructure. I have a web server(apache) and a cache server (varnish). When I load the site directly from web server everything is OK, but when I load the site from the cache, I sometimes get the following error: Timthumb isn't displaying any images. "A TimThumb error has occured I saw some answers about this problem which mainly point out to the file permissions. But I don't get any …
Category: Web

Wordpress 404 on Subdomain

I have taken a copy of my Wordpress website and set up a subdomain, and virtual host (/var/www/subdomain/) on the existing websites server. After moving the copy of the website I am getting a 404 error on all pages except the Home Page and WP Admin area. Apache Conf file below; <VirtualHost *:80> ServerName subdomain.example.com ServerAlias subdomain.example.com DocumentRoot /var/www/subdomain RewriteEngine on RewriteCond %{SERVER_NAME} =subdomain.example.com RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] </VirtualHost> Edited Also below is the SSL Cert apache conf <IfModule mod_ssl.c> …
Category: Web

Moving wordpress to different url/server creates redirect loop

I'm trying to move my wordpress site in to different server and url. How ever i seem to have a persistent redirect loop problem. I think this is not a cache, cookie or plugin problem and I am suspecting incorrect/missing settings in .htaccess file might be the culprit. The server where i am doing the moving from, uses nginx web server and does not have .htaccess file. The hosting provider that i am trying to move into uses apache2 and …
Category: Web

Redirect - remove custom query string

I have a problem with some page URLs. The page URL structure is like this: www.example.com/wp/custom-taxonomy/somepagename/?token=12345 I want that when I access the URL above to redirect me to: www.example.com/wp/custom-taxonomy/somepagename/ In /wp/ is WordPress installed. I tried this in .htaccess: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /wp/ RewriteCond %{query_string} ^token=12345 RewriteRule (.*) /$1? [R=301,L] RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /wp/index.php [L] </IfModule> but it redirects me to: www.example.com/custom-taxonomy/somepagename Any ideas? Later edit: /wp/ - …
Category: Web

Configure .htaccess to have a WordPress single site installation with all subdomains pointing to the same pages?

I need to configure the .htaccess file, for a WordPress single site installation (no multisite), in order to have several subdomains pointing to the same content (same page structure). For example: All three domains should show the same homepage: team-a.domain.com/ team-b.domain.com/ team-c.domain.com/ The same for any subpage, for example the ‘About Us’: team-a.domain.com/about-us/ team-b.domain.com/about-us/ team-c.domain.com/about-us/ How to configure .htaccess to display the same content like that?
Category: Web

issue with wordpress [wp-admin] redirects, when using kubernetes ingress hosting two wordpress websites using path

i'm trying to setup a kubernetes deployment for two wordpress websites in different pods, each will have it's own deployment and service, etc..., under the same ingress, i have setup the ingress this way : apiVersion: networking.k8s.io/v1 kind: Ingress metadata: annotations: cert-manager.io/cluster-issuer: letsencrypt nginx.ingress.kubernetes.io/rewrite-target: /$1 nginx.ingress.kubernetes.io/use-regex: "true" labels: app: app-1 built-by: kustomize name: app-1 namespace: namespace-1 spec: ingressClassName: nginx rules: - host: test.sub.website.com http: paths: - backend: service: name: wordpress-service-1 port: number: 80 path: /(.*) pathType: Prefix - host: test.sub.website.com …
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.