Slash missing before wp-content & Some uploaded images are not showing? - wordpress

Slash missing before WP-content & Some uploaded images are not showing?
For Example:
URL:
www.example.comwp-content/uopload/2017
In this website some images not working

Maybe it's a bit late for you OP, but anyone facing a similar issue and comes across this post, this may be because of a redirection rule in your web server.
I had http redirecting to https and my rule was missing the trailing slash in my new URL, e.g. for Apache:
<VirtualHost *:80>
Redirect permanent / https://www.example.com
...
Fix this by adding the trailing slash:
<VirtualHost *:80>
Redirect permanent / https://www.example.com/
...

if your url completely looking like that : http:="" localhost="" mywebsite="" wp-content="" uploads="" 2020="" 08="" finance.jpg"
you should fix quotes from href.
wrong = style="background-image:url("<?php echo $imageuri['url'] ?>")"
correct = style="background-image:url('<?php echo $imageuri['url'] ?>')"
with " you finishing style quotes

Related

RedirectPermanent htaccess regex

i would like to make redirection 301 in htaccess for wordpress post to my home page
exemple work:
old post = https://www.example.com/keywordkeyworkeyword/
RedirectPermanent /keywordkeyworkeyword/ https://www.example.com
but for some articles I don't have the end of the url !
exemple no work:
old post = https://www.example.com/keywordkeyworkeywordKey...
RedirectPermanent /keywordkeyworkeywordKey(.*)$ https://www.example.com
The RedirectPermanent (mod_alias) directive does not take a regex, it uses simple prefix matching.
You need to use RewriteRule (mod_rewrite) near the top of your .htaccess, before the existing WordPress directives.
For example:
RewriteRule ^keywordkeyworkeywordKey https://www.example.com/ [QSD,R=301,L]
The above redirects any URL that starts /keywordkeyworkeywordKey to the homepage (root URL).
Test first with a 302 (temporary) redirect to avoid caching issues. You'll need to clear your browser cache before testing.

WordPress "Site Icon" missing a trailing slash in image URL

Working on earlycollegecolumbus.com hosted through bluehost.
As soon as I went live, the site logo's image url is missing a trailing slash after the domain name.
Here's what I have tried:
Added a trailing slash in the database "wp_options" table home URL and "normal" URL
Modified wpconfig.php to add
define('WP_SITEURL', 'http://earlycollegecolumbus.com/');
Changed the general settings in WordPress, but it will not allow you to add a trailing slash. (WP Admin > Settings > General)
Updated the site URL in Bluehost settings (My sites > Settings > Site URL)
Because this happened when you went live, the web server is either striking the url. Check the .htaccess or ‘nginx.cong’
Look over the web servers file because iid you find anything like the snippet below.
<VirtualHost *:80>
Redirect permanent /
https://www.example.com
Just add a trailing slash
<VirtualHost *:80>
Redirect permanent /
https://www.example.com/

Wordpress says page "not found" if includes trailing slash in URL?

For every page on this subdomain, if there is a trailing slash it always says page not found, the page only loads correctly without the slash at the end,
eg it doesn't work : abc.com/us/ + redirects to abc.com/us/:
it does work abc.com/us
Every other subdomain in the multisite works correctly
In your .htaccess file,
Add the following .htaccess code to fix the trailing slash issue.
RedirectMatch 301 ^(.+)/$ $1
The above code will remove trailing slash (/) from the URL except the root.

Any way to *rewrite* example.com/blog/ URL to blog.otherdomain.com?

I have a Wordpress blog hosted on one server:
http://blog.example2.com/
And another site on a separate server:
http://www.example.com
Is it possible to get the blog to be served at the following URL?:
http://www.example.com/blog/
If so, I'd love to know how. I messed around with mod-rewrite, but it looks like it will only redirect (not rewrite) to another URL, in this case.
For those interested: I realize I could install the blog on the same server, but I'd rather keep things decoupled for now.
Many Thanks
You'll need to use mod_proxy:
ProxyPass /blog http://blog.example2.com/
ProxyPassReverse /blog http://blog.example2.com/
This'll need to be in server/vhost config. Otherwise, you can use it along with mod_rewrite in an htaccess file (in your document root):
RewriteRule ^/?blog/(.*)$ http://blog.example2.com/$1 [L,P]
ProxyPassReverse /blog http://blog.example2.com/
If you're using cookies in your blog, you'll need to make sure to correct the paths/domains.

htaccess redirect wordpress folder change

I currently have a url of http://example.com/wordpres/
I'm going to change this to http://example.com/w/
I currently get a lot of traffic from links already out on the web. How can I redirect everything that went to /wordpress to /w ?
RedirectMatch 301 ^wordpress(.*)$ /directory/path/to/w/$1
The above line should match every request coming to your domain with 'wordress' at the start and redirect it to /w/. The '301' tells the browser (and search engines) that the page(s) have moved permenantly. The $1 exists to redirect anything after /wordpress/ and append it to the redirected URL. So if I visit http://example.com/wordpress/this-post/ I would get redirected to http://example.com/w/this-post.
Add this rule to your .htaccess file:
RewriteEngine on
RewriteRule wordpress(.*)$ /w$1
If doesnt work.. let me know... :)

Resources