I am trying to develop Wordpress on my local Ubuntu laptop.
On the remote production and staging servers, I can access a page like this via the browser:
On my local machine it is:
Most things work fine, because local permalinks just contain the "index.php" part (and I'm not working on code, not content), but when I use something like get_site_url() it suddenly becomes an issue if I'm on the live site or my laptop.
I know there is some kind of standard DNS thing to deal with it so that $X = get_site_url(); would give me a useful link on both my remote sites and my laptop. What do I do? The best solution would tell me how to eliminate the "index.php" from the URL itself so that my local machine would mirror the remotes.
If I use any of the default permalink structures ["plain", "day and name" etc." it just breaks. I get a message from Apache:
Not Found The requested URL /cart/ was not found on this server. Apache/2.4.7 (Ubuntu) Server at localhost Port 80
If I set the permalink structure to:
Basically, everything works. Except if I'm trying to somehow reference a post or page in a plugin. i.e. I know the title and the permalink are the same, [i.e. title:"hello-world" URL:"http://domain.com/hello-world/"] so:
$URL = get_site_url() . $title;
On my local machine I can't do that because it's forcing me to add this extraneous "index.php" to the permalink.
Anyway... I don't care because I have a few other issues with this laptop. I'm going to wipe it and put a fresh Ubuntu install on it anyway. Hopefully this will just magically go away.