rich menga books search contact

***Secret FSR Fender guitars? Yes, they exist, and they're right here

Amazon links are affiliated. Learn more.

wordpress subdirectory trailing slash problem - FIXED

(Warning: Computer geeky post.)

I'm writing this here for my personal reference just in case I ever had to do this crap again.

Situation: I wanted what's called a "forced www" on all parts of this web site. Some say www is deprecated. I think those people are full of crap (else why would Google do it?)

So I added an .htaccess redirect in the public root of this domain. If I type my domain in a browser, it auto-changes it to have the www in it just like it's supposed to.

My WordPress installation happens to reside in a subdirectory, blog.

Even with the .htaccess redirect, WordPress insists on not adding the www to the web address.

I scoured the internet looking for a solution to this, because no matter what I did, if I typed in my domain with /blog after it, no www would show up. Bleah.

I finally found a solution.

Don't use an .htaccess file in the WordPress subdirectory at all. Put everything in your public root .htaccess instead.

This is what I have now:

# FORCE WWW
RewriteEngine on
RewriteCond %{HTTP_HOST} ^[my domain here].com [NC]
RewriteRule ^(.*)$ http://www.[my domain here].com/$1 [L,R=301]

# WORDPRESS
Rewritebase /blog
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [L]

...and it works. Whether I use a slash or not (such as [my domain].com/blog without the trailing slash,) the www now shows up like it's supposed to.

Yay. 🙂

070905

image
Best ZOOM R8 tutorial book
highly rated, get recording quick!

Learn how to save gas now using the car or truck you already have with hypermiling driving techniques

⭐ Recent Posts

NUX Duotime Stereo Delay Pedal3 solid reasons to use digital delay instead of analog
Switch to digital and you'll enjoy using the delay effect for guitar a whole lot more.

Boss RC-5 Loop Station Guitar Looper PedalWill looper drums ever not suck?
It is amazing that this problem still exists.

The best looking Dean Z I've ever seen
This is an example of when Dean does the Z right.

Black Sabbath - Black SabbathMy favorite Black Sabbath track from their first album
It's not what you think it is.

Epiphone Prophecy Les PaulA secret of the Epiphone Prophecy Les Paul hiding in plain sight
It's right in front of your face and you probably didn't even notice it

🔥 Popular Posts 🔥

Casio F-91WCasio F-91W cheat sheet
A quick guide on how to set the time, date and a few other tips and tricks.

NUX Duotime Stereo Delay Pedal3 solid reasons to use digital delay instead of analog
Switch to digital and you'll enjoy using the delay effect for guitar a whole lot more.

Playing a Squier Bullet TelecasterPlaying guitar in E flat does more than just save your wrists
Everything you ever wanted to know about E flat electric guitar tuning and whether you should use it or not

Fender EsquireThe 5 types of guitars you should never buy
Some guitars that exist where the day after you buy them, you know you've made a mistake.

DigiTech Nexus LibrarianDoes the DigiTech Nexus software for the RP360 really work?
Information on DigiTech Nexus software for the RP360

Vintage guitar of the week #4 - 1974 Fender Stratocaster Natural
What Fender did to save a buck in the '70s ended up with a Strat that has a unique look to it.

NetworkHow to make an animated GIF from a movie clip the free and easy way
GIFs are cool. I pronounce it with a hard 'g'.