ccdiego5
ccdiego5

Reputation: 666

WordPress add doble slash in URL

I'm Dev. WordPress site but this added // into URL.

enter image description here

I don't know how to fix it.

Upvotes: 1

Views: 5725

Answers (4)

Purvik Dhorajiya
Purvik Dhorajiya

Reputation: 4880

Method-1 | wp-config.php

Add these two lines to your wp-config.php, where "example.com" is the correct location of your site.

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

Method-2 | functions.php

Add these two lines to your functions.php.

update_option( 'siteurl', 'http://example.com' );
update_option( 'home', 'http://example.com' );

Note: Both settings should include the http:// part and should not have a slash "/" at the end.

Upvotes: 2

Maciej Palmowski
Maciej Palmowski

Reputation: 56

The list of things to check:

  • site url in settings
  • WP_SITEURL in wp-config
  • .htaccess (backup and delete to check if it worked)
  • change a theme for a moment - maybe this is the reason
  • deactivate all plugins - if double slashes will be removed try activating them one by one until you'll find which causes the problems
  • install your site on WAMP/MAMP/LAMP - check if the problem still exists

Upvotes: 0

PenAndPapers
PenAndPapers

Reputation: 2108

Check your configurations in WP Backend Settings->General, or maybe you've defined a path somewhere in your wp-config file

Edited

try adding define('WP_SITEURL', 'http://your-url.com/'); in wp-config

if your using an apache try to add an .htaccess configuration

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteRule ^post/([0-9]+)?/?([0-9]+)?/?$ /index.php?p=$1&page=$2 [QSA]

refer to this article link

Upvotes: 1

Asep Yayat
Asep Yayat

Reputation: 1

check base url in wordpress config, remove slash after base url

eg. base_url/ change to base_url

Upvotes: 0

Related Questions