InMotion Hosting Support Center

htaccess change puts double slashses (//) in URL after creating subdomain for images

Category: Wordpress

2013-07-31 11:59 am EST

Hits: 7,887

I recently read about the benefits of creating a subdomain to serve up images for WordPress blogs.

It would have been better to do this before making blog posts, but I followed the instructions in this article:

The problem is I'm now seeing double slashes when I'm looking at an image's direct URL path. Here's an example blog post:

The direct URL path for the pizza picture has two (//) slashes:

It doesn't appear that desktop Chrome browser minds the double slashes; it still loads and renders the images.

How do I eliminate the (//) slashes?

You must login before you can ask a follow up question.

You must login before you can submit an answer.

Best answer chosen by User


42,973 Points
2013-07-31 1:28 pm EST
Hello StandardToaster,

Sorry for the issues you're having with the path. There are a few possible causes to the problem. One possibility appears is your use of multisites in WordPress. According to the WordPress Codex, you would need to manually review your paths in the database: Multisite notes

If you are not using the WordPress installation as a multisite, then you may want to consider removing the option.

Another post hinted that it may be caused by a plugin (the plugin author acknowledged the problem). In either case you may want to double-check the paths in the database by looking at it manually. You can use phpMyAdmin to edit the database as necessary.

I did try disabling and re-enabling the permalinks to see if it would have an effect, but so far it's not affecting it. I also tried turning OFF the .htaccess rule that you have added. This gets rid of the double-slash, but also removes your custom re-written path.

The extra slash is coming from WordPress when it's generating the automatic path (based on the permalink) in combination with the .htaccess rule. Both are working the way they are supposed to be working. This is not a server caused issue, but something that appears to be part of how WordPress is generating the path. You may need to send a message to the guy who gave you the instructions for the rewrite. It is possible that the re-write rule needs to be adjusted.

During our testing, I did notice that you removed the graphic. So, I could not continue to troubleshoot the problem. If you do continue to have issues with it, please let us know. If you intend to have us continue to review the problem, could provide us an example of the issue (since you removed the existing one)?

Thanks for your patience!

Arnel C.

You must login before you can post a comment about this answer.

Wow! Thanks for the detailed response, Arnel. That was a really fast response.

So I double-checked paths in the wp_options table and edited the value for "upload_url_path" from "" to "".

I think this change fixed it.

I uploaded another picture to test and there are no double (//) slashes when looking at direct URL path.

Here's test picture:

The image URL appears as:

Now, I say I *think* this fixed it because double slashes will appear for some existing posts' pictures.

For example, the album cover image's URL path in this recent post ( doesn't have the double slashes. Note that this post was published before I made changes to the table.

The image URL appears as:

However the image URL in this older post ( still has the double slashes.

The image URL appears as:

Do you have any explanations around why a newer post isn't plaggued by the (//) while older posts are?

Again many thanks,
38 Points
2013-07-31 2:05 pm EST
Hello Dave!

Thanks for your response! It's no problem. I was researching you question a bit before answering because it was very good question. I think I know the answer for your current question.

It's been my experience that the path is being stored in the database. So, the reason you're seeing it on the post was probably because it was generated at a time when the double-slashes were occurring, and the database captured the double-slash occurrence. Do a search through your database in the wp_posts table. You should see the paths stored in the GUID column.

Hope that helps! If you still need further assistance, please let us know.

Arnel C.
42,973 Points
2013-07-31 2:30 pm EST
I wanted to confirm the "old post" problem was due to the path being stored in the database. I searched through the database, in the wp_posts table, edited the paths stored in the GUID column. And voila - problem fixed.

Thanks again for your help, Arnel.
38 Points
2013-07-31 2:50 pm EST
Like this Question?

Forum Login

You are NOT logged in. You can still browse our Support Center.

To participate within our Community Support Forum:

Need more Help?

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!