As a web developer, you will likely need to make rewrites for clean URLs and produce an htaccess file so you can create ModRewrite rules.

If you encounter a 403 Forbidden Error after creating the htaccess file. This happens because even though the htaccess file itself may have the right permissions, it is possible the web server is not explicitly allowing the rewrites for that directory.

To check for this you should take a look at the webserver error log. The webserver error log may be in different locations depending on your operating system. On Mac OS X it’s in /var/log/apache2/error_log, on most Linux boxes it’s in /var/log/httpd/error_log

for example, you can view the last few errors in the error log by using the tail follow command in the linux command line like this:

Then you can fix the issue by adding the following line to the top of the .htaccess file:

Vim

1

2

3

Options +FollowSymLinks

So that it may look something like this ( the other code should be code specific to your own set up). The important thing to know is that by adding Options +FollowSymLinks you explicitly allowing the rewrites.

Vim

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

Options +FollowSymLinks

RewriteEngine On

# The following rule tells Apache that if the requested filename

# exists, simply serve it.

RewriteCond %{REQUEST_FILENAME} -s [OR]

RewriteCond %{REQUEST_FILENAME} -l [OR]

RewriteCond %{REQUEST_FILENAME} -d

RewriteRule ^.*$ - [NC,L]

# The following rewrites all other queries to index.php. The

# condition ensures that if you are using Apache aliases to do

# mass virtual hosting, the base path will be prepended to

# allow proper resolution of the index.php file; it will work

# in non-aliased environments as well, providing a safe, one-size

# fits all solution.

RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::\2$

RewriteRule ^(.*) - [E=BASE:%1]

RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]

If you are comfortable editing your Apache httpd.conf file, you can add the Options +FollowSymLinks to the directory directive like this:

The “which” command will reveal the absolute path of the executable file called when issuing a command.

The linux which command is useful in determining if you may need to add a path to your $PATH variable in your ~/.profile file in order to be able to issue the command.

Vim

1

2

3

4

5

6

7

promt$>which php

/usr/bin/php

promt$>which wget

/usr/bin/wget

The above example echos out the path. It is possible that there are more than one pathh to the executable file in the $PATH variable.
If you want to echo out ALL the paths in the $PATH variable, then use the -a flag (option)

The Linux find command starts looking wherever you tell it to. This Post is about how to tell it where to start looking for the files you specify when you type out the rest of the find command line.
Specifying the directory is as simple as typing it immediately after the word find, like this:

( in this example we look for a filed named “foo” )

Vim

1

2

3

find/some/directory-name foo

You can limit how deep into the sub directories the linux find command searches by using the maxdepth flag. :

Vim

1

2

3

find/some/directory-name foo-maxdepth5

You can tell the linux find command how deep into the sub directories to start searching as well (-mindepth flag).

Vim

1

2

3

find/some/directory-name foo-mindepth3

Its no problem to specify both how deep into a sub directory to start searching with find and also how far down the directory tree you wish to search by using both flags, like this:

Ever need to change file permissions on files that are scattered who know’s where up under some directory?
Here is a great command to not only change the file permissions, but also take the work out of locating the files you need to change the permissions on.

The find command is a very powerful tool for not only finding files but also for executing commands on the found files on the fly!

In this example we will use the find command and its powerful parameters to locate files and change their ownership.

You will need sudo permissions to do this. Remember, with great power comes responsibility. Be very careful that what you are doing is what you want to be doing. There is not “undo button”. Although, if you use the -print flag you may at least have a record of what files you effected so that you can manually undo your last command.

The above command translates to: “Find, by looking for files (-type f ) in a directory named /the/path/to/some/directory/to/look/in/, files owned by the user “mrfoo”, print a list of the found files with path (-print), then execute the command “chown mrbar:bargroup (on each found file as indicated by the curly brackets {}).” (Notice the escaped semicolon for the end of the command).

Now there is no need to go looking fall all the files in a given directory to change their file owner. This command works for sever other command as well. I recommend you look up the man page for find and start getting familiar with this powerful command line tool.

You may have reason to add a custom field in NetSuite. A caution to take in NetSuite is not to add the field to ALL forms as this may adversely effect others in your NetSuite team.
Here is a simple way to prevent this from happening:

Once you have entered the appropriate data to create your new field, click on the little arrow to the right of the save button.

You will see a drop-down. Select ‘save & applay to forms’.

In the resulting list of forms, click the ‘un-check all’ button.

Then go through and select the forms that you want this field to show up on.

In this way you can be sure to prevent disrupting the work-flow of others on your NetSuite team.