Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

starflamedia on "How to use relative paths that would work after launch?"

$
0
0

Hi All!

I am a big fan of relative paths and no matter what anyone says I will go on looking for cleaner, shorter code no matter what.

When I build a WP site in development environment including local server on my computer or a beta folder under my future domain name, I use images in my posts by ftp upload in a folder called /images/ in the root directory of wordpress. This is so I do not type /wp-content/images, or anything else. It's just what i have assumed as the shortest code I can write like /images/image1.jpg.

How can i and why doesn't WP recognize a path as follows "/images.filename.jpg" when the WP files are in a subfolder such as /beta/ or /test/? It keeps lookig for the images in the root directory of the path even when i have specified the WP folder is either /beta/ or /test/? None of my images would show unless I specify that temporary "beta" or "test" folder!

My workaround has been to add an /images/ and /img/ folders in the root directory of the server during development that I then copy to the specific WP folder right before launch.

None the less, it's been bugging me and it makes it difficult to work on several sites at the same time, since they would share those /images/ and /img/ folders.

Is there any way I can have either an htaccess redirect or WP setting where it would rewrite EVERY RELATIVE PATH WITHIN WP to the correct NEW path? I tried every suggestion for the htaccess that i could find and none have worked so far.

There's no way I will ever consider using the native media importer in WP - the sites I build often have thousands of products with multiple images each. I like to be organized.

The bottom line is - I want to upload my images with FTP and stick to a relative path!

Thank you!


Viewing all articles
Browse latest Browse all 8245

Trending Articles