
46 Cal.2d 856 (1956)
In re J. David Hennigan, on Behalf of LYNN GRITTON et al., on Habeas Corpus.
Crim. No. 5912. 
Supreme Court of California. In Bank.  
July 31, 1956.
 J. David Hennigan, Joseph Shane, Ernest Silver and Hennigan & Ryneal for Petitioners.
 William O. Mackey, District Attorney (Riverside), and Le Moyne S. Badger, Deputy District Attorney, for Respondent.
 SHENK, J.
 In this habeas corpus proceeding the petitioners, Lynn Gritton and Harce R. Bainbridge, seek their release from the custody of the sheriff of Riverside County. Together with one Watkins they were charged with violating Ordinance Number 393 of that county. They were convicted on a second trial by jury in the Municipal Court of the Riverside Judicial District. Each of the petitioners was granted probation on the condition that he pay a fine of $500 and serve six months in the county jail, all but 30 days of which was suspended. The judgments of conviction were affirmed without opinion by the Appellate Department of the Superior Court in and for the County of Riverside.
 At the time of the alleged violations the pertinent provisions of Ordinance Number 393 read as follows:
 "... No person, firm or corporation shall relocate on or move onto any premises, or permit to be relocated on or moved onto any premises owned by him, any building or structure or substantial portion thereof, which is designed for use or is intended to be used for human occupancy as a dwelling or place of business, without a relocation permit therefor having first been applied for and obtained from the Chief Building Inspector."
 "... The fee for filing an application for a permit to move a building within or into the County of Riverside is $20.00; ... If the application is approved, an additional fee of $10.00 shall be paid prior to the issuance of the relocation permit."
 "... Permits for ... buildings [moved onto premises which are not subject to the provisions of the county building *858 code] shall be issued upon application and payment of the required fee."
 Petitioner Gritton, allegedly acting as the agent of petitioner Bainbridge, purchased 50 "G. I." houses located in the city of Oceanside in San Diego County. Gritton knew of Ordinance Number 393 and consulted with the Riverside County Building Department regarding the issuance of permits to move the houses into Riverside County. The record indicates that the building department at all times knew that the petitioners contemplated moving approximately 50 houses. The ordinance required one permit costing $30 for each building moved, or a total payment of $1,500 for permits for the 50 houses. On December 27, 1954, Gritton purchased three permits. By February 1, 1955, Bainbridge had moved 30 to 35 houses onto Watkins' land in Riverside County without purchasing additional permits. On February 8, 1955, Gritton took out three additional permits and was told by the building department that he would have to secure still more. On February 28, 1955, the complaint against them was filed. On March 24, 1955, after all 50 houses had been moved onto Watkins' land, Bainbridge accompanied by Gritton purchased 44 additional permits.
 At the trial the petitioners asserted as a defense that they had assurances from the building department that they could obtain the permits after the houses were moved, despite the requirement in the ordinance that the permits be obtained first. They now contend that the trial court committed numerous errors in admitting evidence. On appeal to the appellate department of the superior court the judgment was affirmed.
 The main contention of the petitioners in the present proceeding is that Ordinance Number 393 as amended at the time of the alleged violations was constitutionally unenforceable as to them. It is not disputed that section 12 of article XI of the Constitution and section 16100 of the Business and Professions Code prohibit a noncharter county such as Riverside County from requiring the purchase of a business license for the purpose of raising revenue. [1] The general policy of the state is opposed to the raising of revenue by the collection of direct taxes as a condition precedent to the conduct of business. (See Wheeler v. Plumas County, 149 Cal. 782 [87 P. 802]; Ex parte Pfirrmann, 134 Cal. 143 [66 P. 205]; Hill v. City of Eureka, 35 Cal.App.2d 154 [94 P.2d 1025]; In re Bock, 125 Cal.App. 375 [13 P.2d 836]; In re *859 McCoy, 10 Cal.App. 116 [101 P. 419].) [2] However, a noncharter county may require a legitimate business to obtain a license if the county's purpose is to regulate or to raise funds to be used in regulating the business. (Bus. & Prof. Code,  16100; County of Plumas v. Wheeler, 149 Cal. 758 [87 P. 909].) The petitioners contend that the enforcement of Ordinance Number 393 as applied to them is to finance the general activities of the county by taxation and not to regulate or finance the regulation of relocation of buildings.
 Ordinance Number 393 is entitled "An ordinance of the County of Riverside to regulate the moving of houses and other buildings onto land in unincorporated territory." As originally enacted on July 29, 1952, the ordinance contained many and seemingly complete regulatory provisions applicable throughout the county to buildings such as those moved by the petitioners. [3] However, on May 6, 1953, approximately 21 months before the alleged violations took place, Ordinance Number 393B became effective. That ordinance amended the original ordinance by adding thereto a new section which provided that the regulatory provisions of the original ordinance were not to apply to the movement of buildings onto property not subject to the county building code. It is conceded that Watkins' land, onto which the petitioners moved their buildings, was not subject to the county building code. And since the ordinance as amended provided that permits to move buildings onto such premises "shall be issued upon application and payment of the required fee," it follows that upon the payment of the fee a permit could not be denied.
 The respondent states that at the time of the alleged violations section 7.1 of Ordinance Number 393 (added by Ordinance No. 393A) still applied to buildings moved onto "noncoded" premises. Section 7.1 provided that "No officer of this county who is authorized to issue a permit to transport upon a county highway any building" to which Ordinance Number 393 applies shall issue a transportation permit until a relocation permit has been issued. However, this section did not authorize any county officer to regulate the transportation of buildings over county highways nor did it indicate in the slightest degree that the purpose of the $30 permit was to finance the regulation of transportation of buildings over county highways. The respondent also suggests that *860 the $30 fee was imposed to defray the cost of supervising the activity carried on by the petitioners. It may not be doubted that Ordinance Number 393 as originally enacted was for that and other regulatory purposes. But by the amending Ordinance Number 393B the regulatory provisions of the original ordinance were entirely removed so far as they were applicable to the activities of the petitioners in the portion of the county where the alleged violations occurred.
 The respondent, however, contends that if amending Ordinance Number 393B renders what is left of Ordinance Number 393 invalid as applied to the petitioners, only Ordinance Number 393B should be invalidated and Ordinance Number 393 should be reinstated in full. In other words, he contends that all of the original provisions of Ordinance Number 393 should be held to be applicable to the petitioners, as though Ordinance Number 393B had never been enacted. This contention is untenable. [4] The board of supervisors affirmatively declared in Ordinance Number 393B that the regulatory provisions of the original ordinance were not to apply to territory in which concededly the petitioners were operating. To reapply the regulatory provisions of the ordinance to that territory would be to entirely ignore the legislative purpose of the board to exclude those provisions of the ordinance from their operation in the noncoded areas in the county. It is not contended that it was not within the power of the board to so legislate but only that if it sought to do so and the result would be to render the remainder of the ordinance invalid in the noncoded areas, its action would be in effect to restore the regulations thus excluded to the entire county. What the respondent thus seeks is to have the court restore to the ordinance as applied to noncoded territory the regulatory provisions of the ordinance which the board has explicitly excluded. Obviously this is not the function of the court. The ordinance therefore remains as a regulatory measure applicable to the territory included within its terms but inapplicable to the petitioners.
 Again it is contended by the respondent that there is still in the ordinance as applicable to the petitioners the requirement of permits before homes may be moved into noncoded territory. But under what is left of the ordinance as applied to the petitioners, the permit cannot be denied upon payment of the fee and the two provisions are inseparable.
 From the foregoing it necessarily follows that the purpose of the ordinance as applied to the petitioners is the payment *861 of the fee only; that this payment is for revenue only, and that the attempted enforcement of the amended ordinance as to them was in violation of section 12 of article 11 of the Constitution and section 16100 of the Business and Professions Code.
 The petitioners are discharged.
 Gibson, C.J., Carter, J., Traynor, J., Schauer, J., Spence, J., and McComb, J., concurred.
