Link paths difference between DEV and PROD
-
This what I’m trying to do and I’ve gone around and around for days.
I have a development site on my local machine so I can test plugins, graphics, formatting, etc. I want to be able to upload files to my production site or cut and paste code in WordPress without having to change link paths but just when I think I have things set up correctly I find an area in which the link paths need to be different.
On the production server WordPress is installed in: https://www.mysite.org/public_html
In WordPress, General Settings the WordPress address (URL) is: https://www.mysite.org
And the Blog address (URL) is: https://www.mysite.org
Permalinks are set to: /%category%/%postname%/
.htaccess is# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
The directory structure is as follows:
/home/mysite/public_html
/home/mysite/public_html/wp-admin
/home/mysite/public_html/wp-content
/home/mysite/public_html/wp-includes
/home/mysite/public_html/images
/home/mysite/public_html/uploads
/home/mysite/public_html/uploads/podpress
An image on a page with this url : https://www.mysite.org/interviews/
resolves with <img src=”/images/label1.png”/>
An image on page 1 of a post with this url : https://www.mysite.org /interviews/nameX/
resolves with <img src=”/images/name1.png”/>
This same image on this post (on the second page using the nextpage tag) with this url : https://www.mysite.org /interviews/nameX/2/
resolves with <img src=”/images/name1.png”/>On my local development server WordPress is installed in: C:\xampplite\htdocs\public_html
In WordPress General Settings the WordPress address (URL) is https://localhost/public_html
And the Blog address (URL) is https://localhost/public_html
Permalinks are set to: /%category%/%postname%/
.htaccess is# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /public_html/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /public_html/index.php [L] </IfModule> # END WordPress
The directory structure is as follows:
C:\xampplite\htdocs\public_html
C:\xampplite\htdocs\public_html\wp-admin
C:\xampplite\htdocs\public_html\wp-content
C:\xampplite\htdocs\public_html\wp-includes
C:\xampplite\htdocs\public_html\images
C:\xampplite\htdocs\public_html\uploads
C:\xampplite\htdocs\public_html\uploads\podpressAn image on a page with this url : https://localhost/public_html/interviews/
resolves with <src=”../images/label1.png”/>
An image on a post with this url : https://localhost/public_html/interviews/nameX/
resolves with <src=”../../images/name1.png/>
This same image on this post (on the second page using the nextpage tag) with this url : https://localhost/public_html/interviews/nameX/2/
Does not resolve with <src=”../../images/name1.png/>Why the differences? What can I do so they resolve using the same paths?
Thanks for your help.
- The topic ‘Link paths difference between DEV and PROD’ is closed to new replies.