Using this PHP code will negate the need to remove the localhost absolute link before uploading edited file.
When using the <base> tag you will have problems when editing on localhost. This php code will detect if you are on localhost or online. Using the ternary operator nothing is added to the relative link permiting the base link to be in effect. If you are using localhost the localhost absolute link that preceeds the relative link is automatically added.
Edit the absolute localhost linkshown in red as needed for your project!
After purchasing a new macbook Air and setting up Apache Server and PHP5 I could not access subdirectories under Sites.
Google searches didnot turn up anything useful and easy until I located this link by John Foderaro:
A mighty big thank you to you John Foderaro for a very well written and easy to follow guide! Bravo!
find: ".bash_profile" near top of files listed.
nano .bash_profile (to edit file and add new macros)
Custom Command Example
^X Exit (which is "ctrl X" after you are done editing.)
y (yes to Save modified buffer)
File Name to Write .bash_profile (simply press enter to accept given name .bash_profile)
Then you should exit and quit Terminal to make new commands functional the next time you open terminal.
The custom command name is what you type into terminal to execute your command.
cd means Change Directory. It is followed by the path to the desired directory.
ls means to list all the files contained in the desired directory.
The advantage of this is you do not have to continually type in a long path name every time you want to go to the desired directory. Simply type the short custom command name and you are there! Listing the files is simply a bonus.
Using Terminal to Wildcard Rename Batch Files
Note: It is a good idea to copy and save somewhere all files you want to rename.
In terminal navigate to the directory that holds the files you want to rename. Then do the following steps in order:
starts the zsh shell
autoload -U zmv
alias mmv='noglob zmv -W'
mmv r36*.png r37*.png
will rename all r36 png files to r37 png files. The * represents the parts of the files that differ.
Note: This course is not free, but is often offered at a significant discount. If you really want or need to get up to speed fast with Regular Expressions, this course can easily be well worth your time.