The live site is installed in myurl.com/wordpress and the dev site is installed in myurl.com/wp.
Does anyone have any ideas as why I am being re-directed?
Thanks.
]]>Hope all is well!
Please update the .htaccess file of the dev site and replace the rules with the below lines
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/wp/
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Where /wp/ is the folder name, wher eteh devlopemtn opy is installed.
Otherwise, please also try this solution:
https://geekflare.com/redirect-subfolder-to-root-folder/
Hope this helps!
Cheers,
Nastia
Thanks for your prompt reply. I have tried both solutions but unfortunately without success.
What do you think is happening to cause the redirect to the live site?
Thanks.
]]>DirectoryIndex /wordpress/index.php
So I guess whatever calls the domain is going to get shunted into the /wordpress directory of the live site and not the /wp directory of the dev site.
I will ponder a solution.
]]>DirectoryIndex /wordpress/index.php
to
DirectoryIndex index.htm
I can no longer run the script /wordpress/index.php – you do not have permission..
Yet I can run /wordpress/hello.php. Both files have exactly the same permissions, owners and group.
This is probably an apache issue but if anyone here knows the answer I would be grateful to here.
Thanks.
]]>In the apache config file;
DirectoryIndex /wordpress/index.php
has been changed to
DirectoryIndex index.htm
Additional directives were added;
<Directory /var/www/vhosts/mydomain.com/httpdocs/wp>
Options +ExecCGI
DirectoryIndex index.php
</Directory><Directory /var/www/vhosts/mydomain.com/httpdocs/wordpress>
Options +ExecCGI
DirectoryIndex index.php
</Directory>
An index.htm document was added to the root directory with a redirect to send live users to /wordpress/index.php
In the dev site the pretty permalinks had to be set to the default – mydomain.com/wp/?page_id=2
Live users get directed to the live site when they type in the domain, I can access my development site simply by adding /wp onto the domain.
I have been able to logon and create a couple of pages and to see these via the web.
I anyone knows of a tidier solution please let me know but this will do for now.
Cheers.
]]>